Page 1 of 1
getting color value
Posted: 30 May 2013 17:21
by matias_thinKing
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
Posted: 30 May 2013 19:53
by Softcore
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
Code: Select all
getattribute(desiredobject, 'color')
where desiredobject = the object you wish to get its color value
(or colors depending on the object)
Re: getting color value
Posted: 30 May 2013 22:31
by matias_thinKing
thank you very much! talk about missing the obvious!!!
Re: getting color value
Posted: 31 May 2013 18:07
by matias_thinKing
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
Posted: 01 Jun 2013 06:38
by Softcore
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
Re: getting color value
Posted: 03 Jun 2013 18:10
by matias_thinKing
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
Posted: 04 Jun 2013 15:16
by Softcore
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!