Return to Snippet

Revision: 40900
at February 9, 2011 21:41 by adrianparr


Initial Code
var magentaRed:int = 255;
var magentaGreen:int = 0;
var magentaBlue:int = 255;
var magentaHex:uint = RGBToHex(magentaRed, magentaGreen, magentaBlue);
trace("magentaHex: ", magentaHex);

function RGBToHex(r:int, g:int, b:int):uint
{
	var hex:uint = r << 16 | g << 8 | b;
	return hex;
}

// OUTPUT
// 16711935

Initial URL

                                

Initial Description

                                

Initial Title
AS3 RGB Colour to Hex Colour (uint)

Initial Tags
color, convert

Initial Language
ActionScript 3