1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Still some color problems

Posted by Mattijs on Dec 11, 2007



In this example i use the code:

colormode(RGB)
c1 = color(0, 1, 1)
fill(c1)
rect(20,20,100,100)
in order to get a RGB value of R 0, G 255, B 255. (or # FF0000)
When i color measure the output of nodebox it gives me R 99, B 202, G 197 (or #63cac5)

Still something i am not getting here...


 
Posted by Giorgio O. on Dec 12, 2007

Hello Mattijs,

I've tried your code and got the same results.
If you try to run this one below you'll see that there's probably a bug in defining colors as c = color(number, number, number). And as far as I can understand probably it is clipping RGB colors to the CMYK gamma. I'm sure that the Nodebox team will fix it soon.

as a quick workaround try this:

size(150,90)
colormode(RGB, range=1.0)
outputmode(RGB)
c1 = color(0, 1, 1)
 
fill(c1) # this clips away RGB
rect(20, 20, 50, 50)
 
fill(0, 1, 1) # this works as it should
rect(80, 20, 50, 50)



Posted by Mattijs on Dec 12, 2007

For me it this code:

fill(0, 1, 1)
rect(80, 20, 50, 50)
still returns the same CMYK color as described in my original post. I read something about the color class where it is possible to work with HEX values, maybe that works out for me.
Maybe you could post a screendump of your generated output?
Thanks for your help.



Posted by Mattijs on Dec 12, 2007

Since installing the color library and the newest version of nodebox everything works fine.