mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-09 15:09:02 +00:00
adjust rgb contrast constant
This commit is contained in:
parent
824da94ffb
commit
5f52f520f4
@ -129,7 +129,7 @@ export const rgbLogShade = (p, c) => {
|
|||||||
* @returns {string} the contrasting rgb color, white or black
|
* @returns {string} the contrasting rgb color, white or black
|
||||||
*/
|
*/
|
||||||
export const rgbContrast = (r, g, b) => {
|
export const rgbContrast = (r, g, b) => {
|
||||||
return Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b)) > 127.5
|
return Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b)) > 165.75
|
||||||
? 'rgb(0,0,0)'
|
? 'rgb(0,0,0)'
|
||||||
: 'rgb(255,255,255)';
|
: 'rgb(255,255,255)';
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user