Return to Snippet

Revision: 64473
at August 11, 2013 01:10 by vamapaull


Initial Code
package com.vamapaull.utils
{
	public class ColorToHexadecimal
	{
		public static function convertToHexString(number:Number):String
		{
			var hexColor:String = number.toString(16);
			while(hexColor.length < 6)
				hexColor = "0" + hexColor;
 
			return hexColor;
		}
	}
}

Initial URL
http://vamapaull.com/color-value-to-hexadecimal/

Initial Description
A simple utility class that will help you convert a color value (from numbers) to hexadecimal color value.

Initial Title
Color Value To Hexadecimal

Initial Tags
number, color

Initial Language
ActionScript 3