Module: utils/color
Table of contents
Functions
Functions
getContrast
▸ getContrast(background
, foreground
): Object
Parameters
Name | Type |
---|---|
background | string |
foreground | string |
Returns
Object
Name | Type |
---|---|
aa | boolean |
aaa | boolean |
contrast | number |
Defined in
utils/color.ts:61 (opens in a new tab)
getContrastColor
▸ getContrastColor(hexColor
): string
Parameters
Name | Type |
---|---|
hexColor | string |
Returns
string
Defined in
utils/color.ts:1 (opens in a new tab)
getRelativeLuminance
▸ getRelativeLuminance(rgb
): number
Parameters
Name | Type |
---|---|
rgb | [number , number , number ] |
Returns
number
Defined in
utils/color.ts:7 (opens in a new tab)
hexToRGB
▸ hexToRGB(hex
): [number
, number
, number
]
Parameters
Name | Type |
---|---|
hex | string |
Returns
[number
, number
, number
]
Defined in
utils/color.ts:16 (opens in a new tab)
mixColors
▸ mixColors(color1
, color2
, percentage
): string
Parameters
Name | Type |
---|---|
color1 | string |
color2 | string |
percentage | number |
Returns
string
Defined in
utils/color.ts:48 (opens in a new tab)
rgbToHex
▸ rgbToHex(r
, g
, b
): string
Parameters
Name | Type |
---|---|
r | number |
g | number |
b | number |
Returns
string