add nanoleaf service
This commit is contained in:
@@ -35,3 +35,11 @@ func (rgb RGB) ToXY() XY {
|
||||
Y: y / (x + y + z),
|
||||
}
|
||||
}
|
||||
|
||||
func (rgb RGB) Normalize() (RGB, float64) {
|
||||
hue, sat, value := colorful.Color{R: rgb.Red, G: rgb.Green, B: rgb.Blue}.Hsv()
|
||||
hs := HueSat{Hue: hue, Sat: sat}
|
||||
newRGB := hs.ToRGB()
|
||||
|
||||
return newRGB, value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user