mirror of https://github.com/Fabio286/mizar.git
5 lines
170 B
TypeScript
5 lines
170 B
TypeScript
|
export const getContrast = (hexcolor: string) => {
|
||
|
if (!hexcolor) return '';
|
||
|
return (parseInt(hexcolor.replace('#', ''), 16) > 0xffffff / 2) ? 'dark' : 'light';
|
||
|
};
|