View Source IdenticonSvg.Color (IdenticonSvg v0.9.5)

Module of IdenticonSvg that contains functions related to handling colors.

Link to this section 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 "#"

Link to this section Functions

Link to this function

color_wheel(list1, list2)

View Source

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 "#"