Parses any recognizable color to the specified kind.
The kind option supports the following types as options (case-insensitive):
'arr' - Parses the color token to an array of channel values with the colorspace as the first element if the omitMode parameter is set to false in the options object.
'num' - Parses the color token to its numerical equivalent to a number between 0 and 16,777,215.
The numberType can be used to specify which type of number to return if the kind option is set to 'num':
'hex' - Hexadecimal number
'bin' - Binary number
'oct' - Octal number
'expo' - Decimal exponential notation
'str' - Parses the color token to its hexadecimal string equivalent.
'obj' - Parses the color token to a plain color object in the mode specified by the targetMode parameter in the options object.t
If the color token has an explicit alpha (specified by the alpha key in color objects and as the fourth and last number in a color array) the string will be 8 characters long instead of 6.
Parses any recognizable color to the specified
kind.The
kindoption supports the following types as options (case-insensitive):'arr'- Parses the color token to an array of channel values with thecolorspaceas the first element if theomitModeparameter is set tofalsein theoptionsobject.'num'- Parses the color token to its numerical equivalent to a number between0and16,777,215.The
numberTypecan be used to specify which type of number to return if thekindoption is set to'num':'hex'- Hexadecimal number'bin'- Binary number'oct'- Octal number'expo'- Decimal exponential notation'str'- Parses the color token to its hexadecimal string equivalent.'obj'- Parses the color token to a plain color object in themodespecified by thetargetModeparameter in theoptionsobject.tIf the color token has an explicit
alpha(specified by thealphakey in color objects and as the fourth and last number in a color array) the string will be 8 characters long instead of 6.