colorPalette

This is a color selection tool that generate a color palette (up to 32 colors) based off the color selected by the user. Users can access the colors using variables or python storage.

For python storage
if you want to access the red value in color 0 you can access this by typing the following code

op(‘colorPalette’).fetch(‘color_values’)[‘r0’]

For variables
if you want to access the red value in color 0 you can access this by typing in the following code

op(‘colorPalette’).var(‘r0’)

Hope ya dig it and feel free to post any ideas/suggestions/comments.
colorPalette.tox (16 KB)

hey partyonmarz,

Cool palette tool here. Giving this a quick look it seems like you’ve got an override CHOP in ‘colorPalette/colorPicker/override1’. Those are handy ops, but it has a tendency to cook every frame, which forces things down stream to cook as well. Looks like it costs about 6-8ms. Do you need that override CHOP? If you cut that from your network you end up with a tool that only cooks when you change colors.

Another micro optimization for you is that you use a TOP in every swatch - you might instead set the color parameters of your constant COMP with your replicator callback script and save yourself all the extra ops and memory.

Just some ideas with a first glance. Nice work!

First off thanks so much for the feedback,

So the override was entirely unnecessary and must have been in there from me troubleshooting/solving a different problem. Super dumb dumb move by me. So I got that sorted, but for the second part I am having some issues optimizing.

I wrote this into the replicator callback

c.op(‘constant*’).par.colorr = me.fetch(‘color_values’)[‘r’ + str(me.digits)]

and it works, but once it replicates once it does not update until it is re-replicated, which is not what I would want the palette to do. Perhaps I am missing something, either way thanks for taking a look.

hey partyonmarz,

Take a look here to see what I mean:

  • Removed override CHOP - tox no longer cooks every frame.
  • Removed the execute DAT and constant TOP from inside of the replicants.
    colorPalette_mr_edits.tox (15.3 KB)

I get it now! It makes a lot more sense to do it this way. Thanks for the quick reply.