add nanoleaf service

This commit is contained in:
2022-08-20 23:48:52 +02:00
parent ca5dc75a1c
commit ae68679228
15 changed files with 1132 additions and 101 deletions
+8
View File
@@ -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
}
+11
View File
@@ -0,0 +1,11 @@
package formattools
const firmament = "****************..."
func Asterisks(s string) string {
if len(s) < 16 {
return firmament[:len(s)]
} else {
return firmament
}
}