# Get(!) color of an object?

**URL:** <https://forum.kirupa.com/t/get-color-of-an-object/291801>\
**Category:** Uncategorized\
**Created:** [July 6, 2009, 5:36am UTC](https://forum.kirupa.com/t/get-color-of-an-object/291801 "2009-07-06T05:36:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sassoFlash](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@sassoFlash](https://forum.kirupa.com/u/sassoFlash)\
**Post date:** [July 6, 2009, 5:36am UTC](https://forum.kirupa.com/t/get-color-of-an-object/291801/1 "2009-07-06T05:36:29Z")

</div>

Maybe I’m missing something really obvious but does anyone have a way of getting (not setting!) an object’s color? I have no problem setting the color and animating it (with caurina Tweener). Here’s an excerpt of what I’d like to do:

```auto

import flash.display.MovieClip;
import flash.geom.ColorTransform;
import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;

private var _btnColor:ColorTransform = new ColorTransform();

// assigns color
_btnColor = btnDownload.btnDownloadColor.transform.colorTransform;
_btnColor.color = 0xCC0000;
btnDownload.btnDownloadColor.transform.colorTransform = _btnColor;

// now if I wanted to know the current color, obvious assumption would be
trace(_btnColor.color) // returns -> 13369344

if (_btnColor.color == 0xCC0000)
{
[INDENT]Tweener.addTween(btnDownload.btnDownloadColor, {_color:0xFF0000, transition:"easeOutQuad", time:1.9});[/INDENT]
}
else
{
[INDENT]Tweener.addTween(btnDownload.btnDownloadColor, {_color:0xCC0000, transition:"easeOutQuad", time:1.9});[/INDENT]
}

```

As you can see from the trace(\_btnColor.color), the following if-statement will not work. What gets returned, looks like a number that gets thrown when something is out of bounds or not the right type. It’s weird because you can SET the color like this:

\_btnColor.color = 0xCC0000;

but you cannot GET the color the same way. Where’s the logic/consistency here? Has anyone an idea of how to get a (hex) color of an object?  
Thanks~
