Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

colorPalette

Share your components here. First one to 100 wins!

colorPalette

Postby partyonmarz » Fri Jul 27, 2018 9:42 pm

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.
Attachments
colorPalette.tox
(16.04 KiB) Downloaded 30 times
partyonmarz
 
Posts: 10
Joined: Mon Feb 27, 2012 9:18 pm

Re: colorPalette

Postby raganmd » Sat Jul 28, 2018 1:30 am

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!
raganmd
 
Posts: 1291
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: colorPalette

Postby partyonmarz » Wed Aug 08, 2018 2:13 pm

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.
partyonmarz
 
Posts: 10
Joined: Mon Feb 27, 2012 9:18 pm

Re: colorPalette

Postby raganmd » Wed Aug 08, 2018 2:40 pm

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.26 KiB) Downloaded 10 times
raganmd
 
Posts: 1291
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: colorPalette

Postby partyonmarz » Wed Aug 08, 2018 3:00 pm

I get it now! It makes a lot more sense to do it this way. Thanks for the quick reply.
partyonmarz
 
Posts: 10
Joined: Mon Feb 27, 2012 9:18 pm


Return to Shared .tox Components

Who is online

Users browsing this forum: No registered users and 8 guests