Skip to content
Snippets Groups Projects
Commit 34907163 authored by HJ's avatar HJ :fire:
Browse files

reduce multiplier to avoid overshooting

parent cafa8da3
No related branches found
No related tags found
1 merge request!2013Fixes Roundup 3
......@@ -236,8 +236,8 @@ export const getTextColor = function (bg, text, preserve) {
let contrast = getContrastRatio(bg, text)
const result = convert(rgb2hex(workColor)).hsl
const delta = result.l > 50 ? 1 : -1
const multiplier = 10
const delta = result.l >= 50 ? 1 : -1
const multiplier = 1
while (contrast < 4.5 && result.l > 20 && result.l < 80) {
result.l += delta * multiplier
result.l = Math.min(100, Math.max(0, result.l))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment