Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayadav09 committed Feb 22, 2024
1 parent 4b3e6b6 commit d4a0b7e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ImageUploaderWithText = ( { image, imageSetter } ) => {
const getContrastingColor = ( color ) => {
/* if the contrast value more than 150 it should have black bg, otherwise white */
const [ r, g, b ] = color.match( /\d+/g ).map( Number );
const contrastValue = 0.2126 * r + 0.7152 * g + 0.0722 * b;
const contrastValue = ( 0.2126 * r ) + ( 0.7152 * g ) + ( 0.0722 * b );
return contrastValue > 160 ? 'black' : 'white';
};

Expand Down

0 comments on commit d4a0b7e

Please sign in to comment.