covert rgb to hex? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: covert rgb to hex? (
/showthread.php?tid=618160)
covert rgb to hex? -
Maheerali - 02.10.2016
My title says every thing. How we can convert rgb to hex.Hex can be in string form.
Re: covert rgb to hex? -
Gotham - 02.10.2016
Use colorpicker.com,or seatch googlr , Integers is used in strings
Re: covert rgb to hex? -
SickAttack - 02.10.2016
https://sampforum.blast.hk/showthread.php?tid=590770
RGBToHex(color,&red,&green,&blue);
Re: covert rgb to hex? -
AbyssMorgan - 02.10.2016
Quote:
Originally Posted by SickAttack
|
This function does not meet expectations. It is used to extract individual values of Red, Green, Blue, [Alpha]
See
Color Converter
Quote:
Originally Posted by AbyssMorgan
If you want to use color to SendClientMessage:
PHP код:
//Functions:
GetColorRGBA(color); //Return {RGB}
GetColorRGB(color); //Return {RGB}
GetColorARGB(color); //Return {RGB}
//Example:
new text[128];
format(text,sizeof(text),"%s this color is FF6600",GetColorRGBA(0xFF6600FF);
If you need clean conversion:
PHP код:
new hex[12];
format(hex,sizeof(hex),"%06x",ShiftRGBAToRGB(0xFF6600FF)); //hex is "FF6600"
format(hex,sizeof(hex),"%08x",0xFF6600FF); //hex is "FF6600FF"
RGB Include:
https://sampforum.blast.hk/showthread.php?tid=590770
|
Re: covert rgb to hex? -
Maheerali - 02.10.2016
Thanks