# Basic Utilities
# getHex
function getRGBString(color: string | number[])
1
# Parameters
# color
- Type:
string | number[]
- Default:
undefined
- Description:
HEX, RGB_STRING, or RGB_ARRAY representation of a color
# Example Usage
getHex('rgb(255, 255, 0)')
'#ffff00'
1
2
2
# getRGBString
function getRGBArray(color: string | number[])
1
# Parameters
# color
- Type:
string | number[]
- Default:
undefined
- Description:
HEX, RGB_STRING, or RGB_ARRAY representation of a color
# Example Usage
getRGBString([255, 255, 0])
'rgb(255, 255, 0)'
1
2
2
# getRGBArray
function getHex(color: string | number[])
1
# Parameters
# color
- Type:
string | number[]
- Default:
undefined
- Description:
HEX, RGB_STRING, or RGB_ARRAY representation of a color
# Example Usage
getRGBArray('#ffff00')
[255, 255, 0]
1
2
2
# changeSaturation
# Parameters
# color
- Type:
string | number[]
- Default:
undefined
- Description:
HEX, RGB_STRING, or RGB_ARRAY representation of a color
# percent
- Type:
number
- Default:
undefined
- Description:
Decimal representation of percent change
# returnType
- Type:
string
- Default:
HEX
- Description:
String representing returned color format - one of ['HEX', 'RGB_ARRAY', 'RGB_STRING']
# Example Usage
const lighter = changeSaturation('rgb(255, 0, 0)', .25, 'RGB_STRING')
'rgb(255, 64, 64)'
const darker = changeSaturation('rgb(255, 0, 0)', -.25, 'RGB_STRING')
'rgb(191, 0, 0)'
1
2
3
4
2
3
4