readableColor
Returns a readable light/dark color based on the provided HEX value. User can provide custom light/dark values.
Parameters
-
hexstring HEX color to change brightness -
optionsObject? user provided object to override default colors
Examples
readableColor('#222001');
// => '#ffffff'
readableColor('#baebd8');
// => '#24292f'
readableColor('#261104', { light: '#fcf' });
// => '#fcf'
readableColor('#fbdbd7', { dark: '#000' });
// => '#A8646'
readableColor('#013735', { light: '#fcf', dark: '#000' });
// => '#fcf'
readableColor('#defbf7', { light: '#fcf', dark: '#000' });
// => '#000'
Returns string light/dark hex value.
Meta
- version: 4.3.0
- Source: readable-color.ts