Error in color computation
-
When using a mid-tone background color (eg #4B73C5) both for background, header & footer color (ie just fill appropriate 2 color fields in ‘Appearance/Customize/Colors’).
Then the hue slider of primary color, keeps producing kind of white, regardless of its position.From the code ‘twentytwenty/assets/js/color-calculations.js’, I could get better results changing:
41-:maxLightness = 80, 41+:maxLightness = 100,
and
74-:if ( 4.5 > item.contrastBackground || 3 > item.contrastText ) { 74+:if ( 2 > item.contrastBackground || 1.5 > item.contrastText ) {
But it is not perfect though. As the code is a bit complex, I hang it to you… Thanks.
- The topic ‘Error in color computation’ is closed to new replies.