Sort Colors

john's Avatar

john

21 Jan, 2025 02:00 AM

A simple yet handy node: sort_colors.

Sort_colors takes a list of colors and sorts them in one of four different ways: luma, hue, saturation, and brightness.

It takes three parameters:

  • Colors. A list of colors
  • Sort by. The property by which you want to sort the colors
  • Reverse sort. If checked will reverse the sort order

Sort_colors is particularly handy when you are stepping through different possible palettes and want to see what the lighter colors look like against the darker colors. Luma is the most useful sort for this task.

The attached demo applies a quartet of colors, chosen from the sanzo_colors node, to a yin yang symbol. The luma sort finds the darkest and lightest colors for the yin and yang, and good contrasting colors for each eye. The demo shows a simple spectrum (extended to seven colors to see intermediate shades) for each of the four possible sorts.

It is fun to step through different yin yang color combinations by changing the quartet number in the sanzo_colors node.

Enjoy!

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • sort_colors_screenshot.png 528 KB
  • sort_colors_demo.ndbx.zip 559 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

Generic

? 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

06 Feb, 2025 01:37 AM
04 Feb, 2025 06:32 AM
04 Feb, 2025 05:04 AM
30 Jan, 2025 09:31 AM
30 Jan, 2025 09:08 AM

 

30 Jan, 2025 08:40 AM
24 Jan, 2025 07:50 AM
22 Jan, 2025 11:42 PM
21 Jan, 2025 09:43 AM
21 Jan, 2025 09:41 AM
21 Jan, 2025 09:36 AM