A sketchy implementation of cubehelix color scheme algorithm for Max/MSP/Jitter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
TFLCL 4d3d98fcc3 changed from rgb2hsl to rgb2luma in helpfile as more in purpose 5 months ago
img readme update 6 months ago
.gitignore authoring, small jit.cubehelix.ui improvements ; ignoring old folder 6 months ago
README.md readme update 6 months ago
cubehelix.genjit cubehelix.genjit now is a file ; auto window resize 6 months ago
cubehelixui-default.json authoring, small jit.cubehelix.ui improvements ; ignoring old folder 6 months ago
jit.cubehelix.maxhelp changed from rgb2hsl to rgb2luma in helpfile as more in purpose 5 months ago
jit.cubehelix.maxpat cubehelix.genjit now is a file ; auto window resize 6 months ago
jit.cubehelix.ui.maxpat authoring, small jit.cubehelix.ui improvements ; ignoring old folder 6 months ago
knob-range.js added missing js 6 months ago

README.md

Cubehelix for Max

By Théophile Clet - september, 2023. First version from 2021. https://tflcl.xyz

jit.cubehelix.ui

What is this

This is an implementation of cubehelix color palette generator algorithm for Cycling74```s Max. It consists of a few files:

  • cubehelix.genjit which is the "low-level" code for cubehlix calculation in the jit world
  • jit.cubehelix.maxpat, an abstraction wrapping cubehelix.genjit as a patcher with some added features for convenience: initialization with attributes, accepts inputs for both ranges (like the D3 implementation) and legacy parameters (start, rotation), converts output matrix...
  • jit.cubehelix.maxhelp, the help file for the [jit.cubehelix] abstraction, with examples and explanations
  • jit.cubehelix.ui.maxpat, which is basically a wrapper for [jit.cubehelix] with an user interface (can be used as a [bpatcher]), randomization capabilities and preset handling (using the pattr system).
  • knob-range.js, a custom [jsui] knob made for [jit.cubehelix.ui] but which can be repurposed for other things. It allows to set a custom output range, randomize the value in an inner range that can be modified with ctrl+drag (change offset) and option/alt+drag (change width). Holding shift allows fine tuning.
  • cubehelixui-default, some default presets for [jit.cubehelix.ui].

How to use

  1. Clone this repo
  2. Put the folder in your Max search paths
  3. Start patching. [jit.cubehelix] and its helper file are a good starting point.

Credits

Heavily based on @mbostock cubehelix implementation in D3.js.

Original cubehelix by Dave Green: Green, D. A., 2011, "A colour scheme for the display of astronomical intensity images", Bulletin of the Astronomical Society of India, 39, 289.

jit.cubehelix helper file example 1 jit.cubehelix helper file example 2