Module of IdenticonSvg that contains functions related to handling colors.
Summary
Functions
Take an list of integers representing the red, green, and blue components of a color as integers in the range 0..255, and return a complementary color based on the provided value of the :compl keyword option.
Convert a hexadecimal color string with 3 characters, with or without a # prefix, to
a hexadecimal color string with 6 uppercase characters. If the input hex color has 6 characters,
return it untouched. Otherwise, raise an ArgumentError.
Convert a hexadecimal color string with 3 or 6 characters, with or without a # prefix, to
a list of integers representing the red, green, and blue components of a color as integers in the range 0..255
Convert an integer in the range 0..255 to a zero-padded hexacedimal string
Convert a list of integers representing the red, green, and blue components of a color as integers in the range 0..255 to a hexadecimal color string with 6 characters, prefixed by "#"
Functions
Take an list of integers representing the red, green, and blue components of a color as integers in the range 0..255, and return a complementary color based on the provided value of the :compl keyword option.
Convert a hexadecimal color string with 3 characters, with or without a # prefix, to
a hexadecimal color string with 6 uppercase characters. If the input hex color has 6 characters,
return it untouched. Otherwise, raise an ArgumentError.
Convert a hexadecimal color string with 3 or 6 characters, with or without a # prefix, to
a list of integers representing the red, green, and blue components of a color as integers in the range 0..255
Convert an integer in the range 0..255 to a zero-padded hexacedimal string
Convert a list of integers representing the red, green, and blue components of a color as integers in the range 0..255 to a hexadecimal color string with 6 characters, prefixed by "#"