Skip to content

Commit

Permalink
Fix ColorChannel (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
capital-G authored Jan 22, 2021
1 parent 0670e70 commit 199e963
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions orx-chataigne/src/main/kotlin/ChataigneOSC.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ open class ChataigneOSC(

init {
osc.listen(key) {
val c = it[0] as Color
currentColor = ColorRGBa(c.red / 255.0, c.green / 255.0, c.blue / 255.0, c.alpha / 255.0)
val red = it[0] as Float
val green = it[1] as Float
val blue = it[2] as Float
val alpha = it[3] as Float

currentColor = ColorRGBa(red.toDouble(), green.toDouble(), blue.toDouble(), alpha.toDouble())
}
}

Expand All @@ -49,4 +53,4 @@ open class ChataigneOSC(
"setup Chataigne with OSC ${osc.address} in:${osc.portIn} out:${osc.portOut}"
}
}
}
}

0 comments on commit 199e963

Please sign in to comment.