RGB Conversion in Lua/TI-Nspire (TI-image)

246 Views Asked by At

I know this may be kinda of a dead and old unanswered topic, but im trying to convert a RGB color code to the string format in a TI-image file, which doesnt make sense to me here:

https://wiki.inspired-lua.org/TI.Image

I understand all it mentions, until I reach the rgb conversion part. The article says that each rgb color has to have 5 bits, but it doesnt tell how to convert it, and i cant make sense of how to convert it following the given example. For instance:

R=255 → R = 31

G=012 → G = 1

B=123 → B = 15

What would I have to do to convert R255, G012 and B123 to the above output?

I understand the remaining instructions on the article, except this.

Anyone have an idea on how to do this?

0

There are 0 best solutions below