Guyn Tools
Convert, find, check and manipulate colors.
Guyn Tools is a collection of Javascript functions to deal with colors.
Convert
rgbToHex
Convert rgb color to hex
; // #000000
hexToRgb
Convert hex color to rgb
; // {r: 0, g: 0, b: 0})
rgbToHsl
Convert rgb color to hsl
; // {h: 0, s: 0, l: 100}
hexToHsl
Convert hex color to hsl
; // {h: 0, s: 0, l: 100}
Checking
isHex
Is this string a hex color?
; // true; // false; // false; // false
isObjectString
Check if a string could be a valid object.
; // false; // true
Hex Strings
toHexChars
Convert a possible hex color code to a valid hex color code
; // #00aa00; // #ffffff;; // #fffaab;
toHexCharsGroup
Convert an array of possible hex color codes to valid color codes.
; // ['#00aa00', '#ffffff']
findHex
Find all Hex colors in a string
; // ['#000000','#aaaaaa', '#abcdef']