Complement Node

john's Avatar


03 May, 2024 12:09 AM

Another new color node: complement!

The complement node creates complementary colors based on a supplied color. It takes the following arguments:

  • Color. The base color
  • Total Colors. The total number of colors you want (including the base color)
  • Wheel. The color wheel or mode used to form the complements. There are four options:
    • Standard - RGB: The classic Red Green Blue color wheel
    • Painter - RYB: A traditional Red Yellow Blue wheel often favored by artists
    • Perceptual - HCL: A perceptually smooth wheel based on an HCL (Hue Chroma Lightness) color model
    • Monochromatic: Generate colors by varying the saturation, brightness, and/or alpha of the base color's hue
  • Saturation Range. The maximum change in saturation from -100% to +100%. Only applies to Monochromatic mode.
  • Brightness Range. The maximum change in brightness from -100% to +100%. Only applies to Monochromatic mode.
  • Alpha Range. The maximum change in transparency from -100% to +100%. Only applies to Monochromatic mode.

The attached demo (see screenshot) shows three possible uses of this node.

  • The blue sky background is a gradient formed by generating 100 monochromatic shades of a blue base, by varying saturation and brightness.
  • The fuzzy sun is created with another monochromatic gradient, this time varying the alpha value as well.
  • The 12-value color wheel is generated with 12 colors complementary to a base red. You can easily generate a standard (equilateral) triadic palette by changing that 12 to a 3. If you instead want to make a "split complementary" palette based on an isosceles triangle, one way of doing this is to generate 12 colors and then use only the first, fifth, and seventh of these.

You can get a good feel of how this all works by adjusting the settings of the three complement nodes controlling the sky, sun, and wheel diagram. Monochromatic complements are great for creating subtle gradients. You can immediately understand the three wheel-based complements by adjusting the base color and trying each of the three wheels.

The demo also includes two other simple networks:

  • The network on the lower right creates color wheels using my donut node. Color wheels are now very easy to make using the complement node.
  • Then network on the upper right shows the hue relationship between the normal RYB hues (controlled by a standard HSB node) and hue values generated from an RYB wheel. Calculating hue values from an RYB wheel is tricky; RYB is not a true color model but rather a rearrangement of standard RGB primaries with underlying subtractive (rather than additive) color mixing, so I could not locate any formulas to do this on the web. To determine a hue value I was forced to recreate an RYB wheel and find the angle at which that hue occurs. To make this easier in the future, I created an RYB_hue node that returns the RYB hue as a value from 0 to 1 (as a standard hue lookup also does). The network plots a curve showing the relationship between the RYB hues (in light red) against RGB hues (the X axis). The initially rising red curve shows how the spectrum from red to yellow is stretched on the RYB wheel, while other parts of the spectrum are compressed. I don't expect anyone but me will ever use the RYB_hue node, but adventurous color theorists may find it useful someday.

The complement node provides another way of generating a palette of colors. It joins my toolbox of similar color nodes:

  • color_brewer
  • colors
  • luma_colors
  • palette

Each of these nodes attacks the challenge of generating color lists from a different angle: preset balanced palettes, random colors between fixed endpoints, colors with a similar luma value, palettes extended from a base palette, and now colors complementary to a base color. You can then use my other color nodes to further tweak these oolors.

Complement will be included in the next release of my node library and is, as always, free to use with no restrictions. Happy coloring!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • complement_node_screenshot.png 757 KB
  • 333 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 Jun, 2024 02:26 PM
15 Jun, 2024 01:44 PM
08 Jun, 2024 09:05 AM
08 Jun, 2024 09:00 AM
04 Jun, 2024 04:37 AM