# ObjectColor method in Python

**URL:** <https://discourse.mcneel.com/t/objectcolor-method-in-python/6408>\
**Category:** Scripting\
**Created:** [February 28, 2014, 1:17pm UTC](https://discourse.mcneel.com/t/objectcolor-method-in-python/6408 "2014-02-28T13:17:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanBayn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/danbayn/32/477847_2.png) [@DanBayn](https://discourse.mcneel.com/u/DanBayn)\
**Post date:** [February 28, 2014, 1:17pm UTC](https://discourse.mcneel.com/t/objectcolor-method-in-python/6408/1 "2014-02-28T13:17:25Z")

</div>

I’m trying to understand how to work with what is returned by the ObjectColor method in Python. Here is a typical example:

Color [A=255, R=191, G=63, B=63]

At first glance this seems like a list, but I don’t believe it is. When I test for the object type, it returns the type as “color”. I can’t find any useful information on how to work with the type “color”.

All I’m trying to do is extract one of the values from the return, for example the R value only and print that.

How would I do that?

Thanks,

Dan

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [February 28, 2014, 1:49pm UTC](https://discourse.mcneel.com/t/objectcolor-method-in-python/6408/2 "2014-02-28T13:49:16Z")

</div>

Hi Dan

the type is System.Drawing.Color:  
[http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx](http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx)

You can use color.R, color.G, color.B, color.A to get the corresponding properties.  
Alternatively you can also use any of the other additional methods that the Color data structure provides.

Thanks

## Giulio

Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![DanBayn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/danbayn/32/477847_2.png) [@DanBayn](https://discourse.mcneel.com/u/DanBayn)\
**Post date:** [February 28, 2014, 3:58pm UTC](https://discourse.mcneel.com/t/objectcolor-method-in-python/6408/3 "2014-02-28T15:58:35Z")

</div>

Hi Giulio,

Thanks for that link. It was very helpful.

Dan
