Int RGB convert to RGB Hex in rules

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.

Integer::toHexString( red ) + Integer::toHexString( green ) + Integer::toHexString( blue )
1 Like

Thank you very much!
You saved me probably a few hours of searching! :slightly_smiling:

KR, Tomaz.

Can you please share you full rule please

Can you share the full example please @rlkoshak@vertom

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 )