Jump to content

Changing Cd saturation with attribute expression


Recommended Posts

Hi everyone, 

I'd like to be able to adjust the HSV via an attribute expression. What's easy is multiplying the point color with something like this: "value * fit(float(rand(@elemnum)),0,1,0.5,1.5)"

However, just using that expression multiplies the color with a random number giving a generally blacker/whiter color. 

What I would like is to be able to change the saturation separately. The result would be a set of X wires having the same color with a saturation/value range of 0.5 to 1.0 

Is there a good way of achieving this or do I need to stick to the simple multiplication?

 image.thumb.png.c61bc4f98768727494b06beac816f188.png

Link to comment
Share on other sites

if you want to use Attribute Expression you can use something like this

hsvtorgb(rgbtohsv(self)+value)

and then the value will represent offset in H, S, V (so start with 0,0,0 and add to corresponding channel as needed)

 

or this

hsvtorgb(rgbtohsv(self)*value)

and then the value will represent scale factor of H, S, V  (so start with 1,1,1 and add to corresponding channel as needed)

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...