# Color problem

**URL:** <https://forum.kirupa.com/t/color-problem/243188>\
**Category:** Uncategorized\
**Created:** [November 4, 2007, 12:29am UTC](https://forum.kirupa.com/t/color-problem/243188 "2007-11-04T00:29:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xannax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/xannax/32/3350_2.png) [@Xannax](https://forum.kirupa.com/u/Xannax)\
**Post date:** [November 4, 2007, 12:29am UTC](https://forum.kirupa.com/t/color-problem/243188/1 "2007-11-04T00:29:17Z")

</div>

Ok I didn’t want to ask for something so stupid and trivial, but I am finishing my project, and after three days without sleep, I am not able to think anymore. I am sure the answer to my problem is very simple, I am just too inexperienced to see it.  
Can anyone help?  
Here’s my prob: I have a database that holds colors. The colors are chosen through a backoffice in PHP/javascript, and stored through mySQL as varchars.  
they are retrieved through a modified class of loader as strings  
Until here, if I trace my color variable, everything is fine;  
Then I have this:

```auto

var rect:Sprite = new Sprite()
trace(color)
rect.graphics.beginFill(uint( **color** ))
rect.graphics.drawRect(0,0,squareSize,squareSize)
rect.graphics.endFill()
addChild(rect)

```

until the trace, the color is what it should be. But the color I see on my screen has nothing to do with the color chosen!  
As an example, here are three colors chosen in the backoffice, and their counterparts, color-picked in photoshop after a printscreen of the website:  
996633 =\> 006633  
333300 =\> 003300  
ffffff =\> 00ffff  
0000ff =\> 003300

Now, what is driving me crazy is if I change the above line

```auto
rect.graphics.beginFill(uint( **color** ))

```

with

```auto
rect.graphics.beginFill(0x0000ff)

```

it works flawlessly.

Anything else fails!  
I’ve tried:

```auto

uint(color)
parseInt(color,16)
uint("0x"+color)
parseInt("0x"color,16)

```

And many other things which I can’t remember now due to huge fatigue…Please help if you can, so I can sleep. I am going crazy over this.  
Thanks in advance.
