SA-MP Forums Archive
int 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: int to hex (/showthread.php?tid=155194)



int to hex - D1ma - 17.06.2010

how can i make some thing that converts int to hex for example that: 255 to that 0000FF,that 0 to that 000000 or that 16776960 to that FFFF00?
thanks


Re: int to hex - Cameltoe - 17.06.2010

it's for colors right? just download a color picker


Re: int to hex - billiout - 17.06.2010

http://www.mathsisfun.com/binary-dec...converter.html

put the int on Decimal: and take the hex color.


Re: int to hex - D1ma - 17.06.2010

Quote:
Originally Posted by billiout
http://www.mathsisfun.com/binary-dec...converter.html

put the int on Decimal: and take the hex color.
never mind
i just wanted to test some thing
thats what i've does:
Код:
if(!fexist("allcolors.txt")){
	new str[60],File:C;
	C = fopen("allcolors.txt",io_append);
	for(new i;i<=16777216;i++){
	  format(str,60,"%06x\r\n",i);
		fwrite(C,str);
	}
	fclose©;
}