HexColor v1.1


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Nikolai Wüstemann
Website: wuestemann.net
Enter a Hex / RGB 8bit / Float value to create your desired color.
Requirements:
11.0, 10.5, 10.0, 9.0, 8.0, 7.1, 7.0, 6.3, 6.2, 6. or later
Linux, Mac, Windows
17 Sep 2018
871

Overview:

 

Node Appearance

This Node works like a Constant.

 

Except you can choose your color value by entering a 

- Hexadecimal color

- standard Nuke float color

- RGB 8bit color

 
 

Settings

 

More Information:

- Changing any value will update all other values respectively

- Colorspace conversions are taken into consideration. sRGB should do the job in the most cases though

- If bugs are found, please comment ;)

 

How to Install:

- the download contains a .nk file and can be pasted in live scripts

- for permanent installation, copy the HexColor.nk file to 'C:\Users\username\.nuke'

- edit the file 'C:\Users\username\.nuke\menu.py' and add the following line:

nuke.menu('Nodes').addCommand('Other/HexColor', lambda: nuke.createNode('HexColor.nk'))

Please login in order to download these files.

Comments   

 
0 # Harry Hextall 2019-04-24 11:02
Hello, When I input a HEX value, the float value doesn't change on my Nuke. Any thoughts?

EDIT: Temp fix is to write expression in each RGB Float value to be the below divided by 255
 
 
0 # Nikolai Wüstemann 2019-04-29 11:40
Hi, it works fine for me, changing the Hex field changes both float and 8bit values. What Nuke Version are you running? What does the Script Editor say?
 
 
0 # Harry Hextall 2019-04-29 12:09
Hey, thanks for getting back to me.

When i input any HEX value, the RGB changes to the correct value, but the float does not.

The script editor says the following:

ValueError: unable to sample node for given channel (rgba.red) at current context

NukeX 11.0v1
 
 
0 # Chris Charlton 2021-07-20 06:08
Try adding this below the node as a fix: set cut_paste_input [stack 0]
version 10.5 v5
push $cut_paste_input
Expression {
expr0 input.color_8bit_r/255
expr1 input.color_8bit_g/255
expr2 input.color_8bit_b/255
name Converter
selected true
xpos -2460
ypos -897
}
 
 
0 # Nikolai Wüstemann 2021-07-20 07:37
Yeah the whole thing tends to be a bit buggy.
The idea was to have a live conversion between all of the input fields.
I implemented a sample function to make use of the sRGB colorspace, so a web color is translated correctly.For now I only have issues, when Linear is set as colorspace.
Maybe a solution would be better with a switch at the end that is set to whatever conversion was done last and to avoid the nuke.sample() function, which is the cause of many errors.

edit: more difficult that I thought, because I still need to translate the values into the other knobs, after being procssed by the colorspace. Only way I can think of now is to find a python or TCL implementation of colorspaces (or just sRGB)

edit2: found this: www.cyril-richon.com/blog/2019/1/23/python-srgb-to-linear-linear-to-srgb and probably gonna implement this down the road.
 
 
0 # Lundy Hu 2022-06-17 19:54
nuke.sample deprecated, use Node.sample instead.

https://learn.foundry.com/nuke/developers/latest/pythondevguide/_autosummary/nuke.Node.html#nuke.Node.sample
 

You have no rights to post comments

We have 3297 guests and 126 members online