added correct clamping

This commit is contained in:
2018-06-29 03:13:56 +02:00
parent c199f445dd
commit eb0a70d87d

10
ledd.go
View File

@@ -179,9 +179,13 @@ func (manager *LEDManager) color(led *LED) {
cMap := make(map[int32]int32) cMap := make(map[int32]int32)
cMap[led.Channel[0]] = int32(color.Clamped().R * float64(backend.resolution)) if !color.IsValid() {
cMap[led.Channel[1]] = int32(color.Clamped().G * float64(backend.resolution)) color = color.Clamped()
cMap[led.Channel[2]] = int32(color.Clamped().B * float64(backend.resolution)) }
cMap[led.Channel[0]] = int32(color.R * float64(backend.resolution))
cMap[led.Channel[1]] = int32(color.G * float64(backend.resolution))
cMap[led.Channel[2]] = int32(color.B * float64(backend.resolution))
wrapperMsg := &ledd.BackendWrapperMessage{ wrapperMsg := &ledd.BackendWrapperMessage{
Msg: &ledd.BackendWrapperMessage_MSetChannel{ Msg: &ledd.BackendWrapperMessage_MSetChannel{