Convert RGB Player Colors to HEX Code for Textdraws?

Started by Pun1sh3r, Aug 11, 2015, 05:10 PM

Previous topic - Next topic

Pun1sh3r

Hello all,

I want to Improve my Deathlist and make it colored and I want to convert the Player Color to HEX Code for Textdraws.
How exactly I can do this? I was trying to make it possible but failed cause one time the server said "Expected int and got string"


Would be nice if anyone of you can help me out with this Problem, thanks!

DizzasTeR



DizzasTeR

If you are talking about using different colours in textdraw, its not possible, if you want to colour then you can convert your RGB to Hex you can use that site.

Thijn

You probably mean something like:
local color = RGB( 255, 0, 0); //Red.
local drawColor =  color.r << 24 | color.g << 16 | color.b << 8 | 255 );

Where that last 255 is the alpha.

Pun1sh3r

Quote from: Thijn on Aug 11, 2015, 06:10 PMYou probably mean something like:
local color = RGB( 255, 0, 0); //Red.
local drawColor =  color.r << 24 | color.g << 16 | color.b << 8 | 255 );

Where that last 255 is the alpha.

Exactly, thanks!