Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

HSV CHOP to TOP

Still a little green? Ask your beginner's questions here

HSV CHOP to TOP

Postby Fundak » Tue Aug 14, 2018 4:27 pm

Hi,
I'm trying to convert HSV value in CHOP to TOP. CHOP to has only RGB setting (all kind but not HSV). Is there any way to do it?

I was thinking of going from HSV CHOP to TOP, then HSV to RGB, and back to CHOP. It's only single colour pixel.

What I'm trying to do is to change phong emit value based on CHOP. I know hue and saturation (constants) and only want to flash it with value, based on other events. I can't simply export HSV values to phong emit (or maybe can I?).

Sincerely
Fundak
 
Posts: 9
Joined: Wed Nov 19, 2014 12:54 pm

Re: HSV CHOP to TOP

Postby ben » Wed Aug 15, 2018 4:16 pm

There is a colorsys module in python that lets you convert between colorspaces

https://docs.python.org/3.5/library/colorsys.html

You can use this in TD parameters using the mod function
Code: Select all
mod.colorsys.hsv_to_rgb(0.5, 0.5, 0.4)


which returns a tuple so if you wanted the red channel for example
Code: Select all
mod.colorsys.hsv_to_rgb(0.5, 0.5, 0.4)[0]
Attachments
hsv_to_rgb.tox
(486 Bytes) Downloaded 72 times
User avatar
ben
Staff
 
Posts: 2599
Joined: Thu Nov 08, 2007 6:55 pm
Location: Toronto

Re: HSV CHOP to TOP

Postby hunt.casey » Tue Aug 20, 2019 2:07 am

Yo!
I was fiddling with the HSV/RGB converter tops trying to a similar thing.
The python code was super helpful to getting the thing accomplished, so thanks @ben for posting the solution!!!
hunt.casey
 
Posts: 31
Joined: Sat Feb 03, 2018 10:35 pm


Return to Beginners

Who is online

Users browsing this forum: No registered users and 16 guests