Looking for Dynamo node can do random choice of 3 RGB colors


#1

I am doing a random color tiles exercise in Dynamo Studio and intend to send it to Project Fractal. The best I could do is only the different tone (0-255) of one color. If I wan to randomize only 4 colors on the tiles, what nodes I can use from Dynamo Studio?

Thanks.


#2

I added these nodes but it doesn’t give the randomness of three colors.


#3

it appears you are shuffling the outer lists, not the inner color component lists. I think you should just use randomList node and then remap the values.


#4

I believe a range nested in a Math.Random function which is then multiplied by 255 (maximum colors) and then rounded off should work.


#5

The goal is randomly apply 1 of 3 selected RGB color to the tile. Let’s say Orange, Pink and Cyan. I have three sets of RGB. How do I make Dynamo to randomly pick 1 of 3 colors each time generating the next tile?


#6

One possibility:


#7

Thank you. It seems working. Let me try to apple the color selection portion on the script.


#8

I still getting one color on all tiles. let me see where the logic problem is but your suggestion should be the right path.


#9

The ‘List.GetItemAtIndex’ in my node is different then your. Yours have an ‘Item’ at the output. The one I have is a ‘var[]…[]’. For unknown reasons, I can’t plug the output directly to ‘color’ input on ‘Display.ByGeometryColor’.


#10

You’re getting different behavior because in my case I have a list of colors where as in your case, you have a list of sub-lists of color values. Since you have only a few colors, it would be more efficient to pass the color reference than to rebuild it from scratch every time.


#11

Also, I am intended to send to Project Fractal so I can only use the Dynamo Studio native node. The color nodes in your script seems like a custom node.


#12

If you wanted random color…


#13

The nodes are very efficient. It will be useful in a random color exercise.


#14

It’s just the built in color node with some predefined inputs. You can definitely use that instead.


#15

Thanks everyone’s input. It finally works.