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

Reference | colormode()

colormode(mode, range=1.0)

DescriptionChanges the way NodeBox interprets color data. By default, fill() and stroke() are set by values between 0.0 and 1.0 using the RGB color model. RGB corresponds to Red/Green/Blue. Alternatively HSB (Hue/Saturation/Brightness) or CMYK (Cyan/Magenta/Yellow/Black) can be specified. Regardless of which colormode is specified, PDF's and images are exported in the specified outputmode(). The optional range parameter specifies whether color values are defined between 0.0 and 1.0, or something else, 0 and 255 for example (range=255).
Returnsthe current color mode (RGB, CMYK or HSB)
Tutorial Colors

fill(0.25, 0.25, 0.25)
rect(10, 10, 40, 40)
fill(0, 0, 0.25)
rect(60, 10, 40, 40)