1.

Solve : RGB to Long and Back?

Answer»

It's quite easy to CONVERT RGB colour to Long as used in the Property Sheet EVEN without the RGB function, but what about the other WAY around? I managed to work it out, so I'll reproduce it here for anyone who is interested. I've also shown the RGB to Long formula for reference.

RGB to Long
L = R + (G * 256) + (B * 65536)

Long to RGB
R = (L Mod 65536) Mod 256
G = Int(L Mod 65536 / 256)
B = Int(L / 65536)



Discussion

No Comment Found