getting color value
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
getting color value
hi all - is there a way of getting the value of a color after it has been chosen within the color palette? I would like to ensure I am using the exact same color on different objects as well as ensuring I go back to the right color from one chosen from the palette after making an object multi-colored. thank you in advance for any info. (side-note - I don't have photoshop or some other solution that would allow me to click on an area of the computer screen to pick the color within that pixel)
Re: getting color value
getattribute(object, attribute) doesnt give you what you want? I find it extremely useful to get direct 0 to 8355711 values for an object's color which I then also use directly in my scripts to set colors (instead of using rgb(r,g,b) or HSV(h,s,v))
Just set a monitor and set its value as
where desiredobject = the object you wish to get its color value
(or colors depending on the object)
Just set a monitor and set its value as
Code: Select all
getattribute(desiredobject, 'color')
(or colors depending on the object)
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: getting color value
thank you very much! talk about missing the obvious!!!
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: getting color value
interestingly, it's not returning the right color ... when re-painting the object with the color value returned from getattribute, it's coming back brighter than what it's set to. when I chose the color via the palette, I edited the shade via the HSV palette, so I'm wondering if somehow it's retaining the value before this adjustment in whatever variable getattribute returns
Re: getting color value
No, it always returns the current color! What object are you getting the color attribute for? Perhaps you need 'colors' instead of 'color' - check the object's attributes in the manual reference
-
- Newbie
- Posts: 45
- Joined: 19 May 2013 17:58
Re: getting color value
I shall keep testing, but the switch was set to only have 1 off color at the time I measured it, so colors didn't seem like the appropriate attribute. Thank you for the info none-the-less. whether it's a bug in the lemur software, or my own user error, we shall find out... but either way, you pointed me to the obvious answer I was seeking!
Re: getting color value
Having the multicolor option enabled, that may "hide" color on option from the editor but you still have two colors for the switch - the getattribute SHOULD return with a vector containing two colors, off and on!