Posted By

vamapaull on 08/11/13


Tagged

number String Value color hexadecimal


Versions (?)

Color Value To Hexadecimal


 / Published in: ActionScript 3
 

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

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

  1. package com.vamapaull.utils
  2. {
  3. public class ColorToHexadecimal
  4. {
  5. public static function convertToHexString(number:Number):String
  6. {
  7. var hexColor:String = number.toString(16);
  8. while(hexColor.length < 6)
  9. hexColor = "0" + hexColor;
  10.  
  11. return hexColor;
  12. }
  13. }
  14. }

Report this snippet  

You need to login to post a comment.