vertom
(Tomaz Verbič)
February 22, 2016, 2:27pm
1
Hello,
i’m pretty new here and now i’m working on Color Picker to send values on mqtt.
The RGB int is working fine, but i cant find, how to convert these values to hex string
like these
#FFFFFF .
Is these possible or not? i cant find any example of this?
KR, Tomaz.
rlkoshak
(Rich Koshak)
February 22, 2016, 5:39pm
2
Integer::toHexString( red ) + Integer::toHexString( green ) + Integer::toHexString( blue )
1 Like
vertom
(Tomaz Verbič)
February 22, 2016, 7:58pm
3
Thank you very much!
You saved me probably a few hours of searching!
KR, Tomaz.
Can you please share you full rule please
Daksh
(Daksh )
July 14, 2020, 8:06pm
5
Can you share the full example please @rlkoshak @vertom
rlkoshak
(Rich Koshak)
July 14, 2020, 8:29pm
6
I don’t have a full example to share. I don’t use color lighting. Somewhere red
, blue
, and green
are defined as int
or Integer
. Then then
val hexString = "#" + Integer::toHexString( red ) + Integer::toHexString( green ) + Integer::toHexString( blue )