I want to create random colors. It’s a list based on six discrete fRGB values:
0, 0, 1: red
0, 1, 0: green
0, 1, 1: yellow
...
1, 1, 1: white
So I was thinking I start with a random number, then use bitwise operations, but there seem to be no bitwise operations in Grasshopper.
Any suggestion?
Copy the left part three times, connect the three outputs to a Point component then you won’t even need the right side
feklee
May 30, 2019, 10:16am
3
Can you elaborate? Just feeding individual random numbers into R, G, and B won’t work, because then I would also get 0, 0, 0
, which I don’t want and which my solution avoids.
Yeah, I didn’t think that through, I am on the phone.
I’ll create something now and posted here.
You can just use the 3 seeds in one random component, then use explode tree (BANG) after the random component.
2 Likes
theoretically it should’ve worked with my original idea to add them into a point component. but now I see the point has curly brackets while the color doesn’t. disappointing.
Piotr
May 30, 2019, 10:28am
8
Or for real random values use Random component from Heteroptera.
Piotr:
Heteroptera
I hate using 3rd party plugins
Random can output integers so you can use that. Right click on components. One Random is enough
Or another solution
colors_LD.gh (18.2 KB)
1 Like
feklee
May 30, 2019, 10:35am
11
@ivelin.peychev The solution you posted in the picture also includes black. (0, 0, 0)
My proposal would be super easy to code and it would work. Just in Grasshopper it’s a pain. Are there really no bitwise operations?
feklee
May 30, 2019, 10:36am
12
Thanks for the suggestion. Now without black.
If you just want to keep a list of 6 colors, keep it in a list, duplicate the list and use Jitter component !
1 Like
nathanletwory
(Nathan 'jesterKing' Letwory)
May 30, 2019, 10:38am
14
You can also use the Colour Wheel and feed it the number of colors you want in your palette.
2 Likes
feklee:
bitwise operations
I don’t know what that means
feklee
May 30, 2019, 10:42am
16
I don’t understand how to create the six RGB colors red, green, yellow, …, and white easily with the color wheel. It seems again another cumbersome solution.
feklee
May 30, 2019, 10:46am
18
ivelin.peychev:
Cumbersome?
Well try creating: red (255, 0, 0), green (0, 255, 0), yellow (255, 255, 0), …, white (255, 255, 255)
Do you only need these colors?
Then use what @laurent_delrieu suggested
If you just want to keep a list of 6 colors, keep it in a list, duplicate the list and use Jitter component !
^^that’s the way to go by @laurent_delrieu
1 Like