added correct clamping
This commit is contained in:
10
ledd.go
10
ledd.go
@@ -179,9 +179,13 @@ func (manager *LEDManager) color(led *LED) {
|
||||
|
||||
cMap := make(map[int32]int32)
|
||||
|
||||
cMap[led.Channel[0]] = int32(color.Clamped().R * float64(backend.resolution))
|
||||
cMap[led.Channel[1]] = int32(color.Clamped().G * float64(backend.resolution))
|
||||
cMap[led.Channel[2]] = int32(color.Clamped().B * float64(backend.resolution))
|
||||
if !color.IsValid() {
|
||||
color = color.Clamped()
|
||||
}
|
||||
|
||||
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{
|
||||
Msg: &ledd.BackendWrapperMessage_MSetChannel{
|
||||
|
Reference in New Issue
Block a user