General
getting color value
Started by matias_thinKing on .
Sign in or create an account to join the conversation.
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)
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
(or colors depending on the object)
Just set a monitor and set its value as
getattribute(desiredobject, 'color')
where desiredobject = the object you wish to get its color value(or colors depending on the object)
thank you very much! talk about missing the obvious!!!
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
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

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!
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!