algorithmic modeling for Rhino
So I am just playing around with the gradient node and noticed something strange.
If I double click one of the control points in the gradient you can set the ColorLeft and ColorRight.
If I do that and pick for example white for ColorLeft and black for ColorRight, then the output is not RGB values anymore for pure white, but the string "white", thus making any calculations using the values impossible.
Is there a way to:
a) have the gradient always output numerical values
or
b) convert rbg values mixed with strings of pure colors (white, black, etc.) to only numerical values
Thanks, Armin.
Tags:
Ok, so I just noticed if I enter 255,255,255 it uses the numerical values in the output. Strangely if you enter something invalid, for example just accidentally put "255.255.255" it says "255.255.255 is not a valid value for Int32". But how can a string be a valid Int32?
This must be some sort of system thingy. Very strange indeed.
PS: I should mention that the reason I need numerical values is that I just need the Lightness value of the color. To be able to convert RGB to HSL I need proper values though.
Ah ok there is a color split node. Doh!
It converts it to numbers. Ok, so now its easy to convert to HSL using 3 inputs instead of 1.
Thanks!
ps: for future reference if someone comes across this, the code inside the C# node is:
System.Drawing.Color color = Color.FromArgb(R, G, B);
H = color.GetHue();
S = color.GetSaturation();
L = color.GetBrightness();
Ok, thats true. But HSV is not the same as HSL ;)
Actually it seems that the HSV component is actually outputting HSL and not HSV.
http://en.wikipedia.org/wiki/HSL_and_HSV
I think this is why there is a "split AHSV" and a "color AHSL" node. Why not have a split and join for both, but a split for one and a join for the other!?
That is true. But the V is not the same as L. So you're right, that I can use the HSV component in this case. But it means that the HSV component should be called HSL (see below).
Report it as a bug
Just did ;)
It would seem Daniel noticed this last week, but you would need to translate the post to see that: http://www.grasshopper3d.com/forum/topics/assign-a-number-to-a-colo...
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by