XWidgetSoft Forum
https://www.bbs.xwidget.com/

Convert integer to RGBA
https://www.bbs.xwidget.com/viewtopic.php?f=10&t=2128
Page 1 of 1

Author:  vlad [ September 14th, 2012, 5:21 am ]
Post subject:  Convert integer to RGBA

Code:
function intToRgba(value)
{
         var color = {R:0,G:0,B:0,A:0};

         color.B = value& 0xFF;        value>>= 8;
         color.G = value& 0xFF;        value>>= 8;
         color.R = value& 0xFF;        value>>= 8;
         color.A = value& 0xFF;        /* value>>= 8; */

         color.toString = function ()
         {
          return "Color R:" + this.R + " G:" + this.G + " B:" + this.B + " A:" + this.A;
         }

         return color;
}

Author:  Tony [ September 20th, 2012, 6:08 pm ]
Post subject:  Re: Convert integer to RGBA

Hi, you can uses this function "rgba" to make color
Code:
  text1.font.fill.color = rgba(255,0,0,200);

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/