Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorToHex ¶
ColorToHex turns a color.RGBA into a hexadecimal color code e.g. #FBEE13. The alpha value is ignored.
func ExactlyOne ¶
ExactlyOne returns true iff one of the given booleans is true
func HexToColor ¶
HexToColor turns a hexadecimal color code (e.g. #FBEE13) into a color.RGBA.
func RemoveWhitespaceStrings ¶
RemoveWhitespaceStrings removes any strings from the input slice that contain only whitespace and trims whitespace from the remaining lines.
Types ¶
type RGB ¶
RGB is an alias for color.RGBA but with JSON marshaling methods that convert to & from hexadecimal color codes.
func (*RGB) MarshalJSON ¶
MarshalJSON converts the RGB color into a hex value (e.g. "#FBEE13")
func (*RGB) ToHex ¶
ToHex returns the hexadecimal representation of the RGB value, e.g. #FBEE13. The alpha value is ignored.
func (*RGB) UnmarshalJSON ¶
UnmarshalJSON converts a hex value (e.g. "#FF0000") to an RGB struct