FIX: LED Colors (in hsv now)
This commit is contained in:
@@ -2,8 +2,8 @@ import Color from 'color'
|
|||||||
|
|
||||||
export const colorToLED = (color: Color) => {
|
export const colorToLED = (color: Color) => {
|
||||||
if (!color) return null
|
if (!color) return null
|
||||||
const l = color.lightness()
|
const l = color.value()
|
||||||
if (l < 0.5) return color.lightness(0)
|
if (l < 1) return color
|
||||||
const nl = 1 - Math.pow(l / 50 - 1, 4)
|
const nl = 1 - Math.pow(l / 100 - 1, 2)
|
||||||
return color.lightness(nl * 35 + 20)
|
return color.value(nl * 70 + 30)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user