PDA

View Full Version : Color to individual RGB values?



JeffrySG
09-30-2009, 08:09 AM
Is there a way to pick a RGB color and have a node turn that into three separate values for each of the R, G and B values?

For example if there was a blue color of 38, 163, 205, I would want a node that would separate out each of the color channels to give me a scalar value for each of the numbers.

I see how the 'Make Color' node does exactly the opposite of what I'm looking to do. I know I can put in the values manually into separate nodes but I'm trying to be able to pick a color visually and then have it break apart into the channels.

Thanks for any assistance. :)

Lightwolf
09-30-2009, 08:15 AM
Check my sig for the latest db&w Tools. The Channel Blender node does just that (and a little more).

Cheers,
Mike

JeffrySG
09-30-2009, 08:20 AM
Check my sig for the latest db&w Tools. The Channel Blender node does just that (and a little more).

Cheers,
Mike

That's great Mike! Thanks!

I actually had your nodes installed already but it wasn't immediately clear to me that the Channel Blender node would do that. I see how it works perfectly for that now! :D

Cheers!

JeffrySG
09-30-2009, 08:29 AM
Mike,

Just to be sure I'm using the node correctly; In this node setup are the x, y and z outputs sending out the individual RGB values? and are the values between 0-1 or are they 0-255?

http://i37.tinypic.com/2ninneq.png

Thanks,
Jeff

Lightwolf
09-30-2009, 08:37 AM
Mike,

Just to be sure I'm using the node correctly; In this node setup are the x, y and z outputs sending out the individual RGB values? and are the values between 0-1 or are they 0-255?

http://i37.tinypic.com/2ninneq.png

Thanks,
Jeff
Yes and Yes.
Internally (LightWave) there is no real difference between colours and vectors. Both have three floating point components/channels. In the case of a colour, 1.0 is equivalent to 255 in an 8bit per component colour mode.

I suppose I could duplicate the code for the node, call it Colour Blender, and re-name the outputs. Other that that it would be completely identical though.

Cheers,
Mike

JeffrySG
09-30-2009, 10:15 AM
Ok, that makes perfect sense now. I just wanted to make sure I fully understood what was going on with the node.

Thanks again, Mike!

Lightwolf
09-30-2009, 10:18 AM
Ok, that makes perfect sense now. I just wanted to make sure I fully understood what was going on with the node.

No worries, understanding is good :D

Cheers,
Mike

JeffrySG
09-30-2009, 11:10 AM
Thanks again... I was able to do what I needed... Here's the node if you'd like to see or use.

http://www.newtek.com/forums/showpost.php?p=931713&postcount=20