feat: change threshold to switch black SVG img to white
This commit is contained in:
parent
148c119c05
commit
a239633fae
1 changed files with 2 additions and 1 deletions
|
@ -410,7 +410,8 @@ L.DomUtil.contrastedColor = (el, bgcolor) => {
|
|||
rgb = L.DomUtil.RGBRegex.exec(rgb)
|
||||
if (!rgb || rgb.length !== 4) return out
|
||||
rgb = parseInt(rgb[1], 10) + parseInt(rgb[2], 10) + parseInt(rgb[3], 10)
|
||||
if (rgb < (255 * 3) / 2) out = 1
|
||||
const threshold = 140
|
||||
if (rgb < threshold * 3) out = 1
|
||||
if (bgcolor) _CACHE_CONSTRAST[bgcolor] = out
|
||||
return out
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue