1

I have a bluetooth device (led light) to which I can send different commands to. By now everything works fine and all the commands work. Now I want to send a custom command. The documentation says the following: [0X99] + [24 bit colorimetric value (R=?,G=?,B=?)] + [8bit speed value] + ...

Now I don't know how to get the 24 bit colorimetric value from an UIColor.

Patricks
  • 641
  • 1
  • 11
  • 21

1 Answers1

0

Refer to this SO Post. This shows how to convert uicolor to its rgb component values.The values are returned as a float ratio. You can convert this ration to base 8 color and send to the device.

Hope this helps.

Community
  • 1
  • 1
Md. Ibrahim Hassan
  • 5,074
  • 1
  • 20
  • 44