Docs Visual
ColorGenPro
A cosine palette generator in GLSL: the full coefficient set per channel, an RGB and D mode, blackout and soft regions, and a lookup ramp as a second output.
◧ Visual ◆ Patreon:Pro
This tool unlocks with Patreon. It installs through the same picker as everything else and unlocks with the Patreon Pro tier or higher, connected from inside TouchDesigner. Everything else in the toolkit stays free and MIT, and the membership is what keeps that work moving.
What it is
ColorGenPro builds a palette from the cosine palette formula, pow(a + b*cos(2PI*(c*t+d)), e) per channel, with every coefficient open. Offset, amplitude, period, phase and exponent for red, green and blue give smooth gradients that loop cleanly and animate with a single phase; the RGB and D mode collapses them to one offset, amplitude and exponent when you want fewer knobs. Blackout reserves part of the palette for black, either by extending the length or by taking it from the colours, with a soft edge you shape. Length sets how many colours the lookup holds; the palette comes out as a colour strip and as a lookup ramp.
It is the Pro sibling of ColorGen, which shapes its palette with a phase step and exponents instead. It is a member of the FNS operator family: pick it from the FNS tab of the OP Create dialog and it lands as one node.
Inputs and outputs
- in1 (TOP): the image to colour through the palette; with nothing wired, a built-in 0 to 1 ramp is used, so both outputs show the palette on a bare drop.
- out_col (TOP): the palette strip.
- out_lookup (TOP): the input coloured through the palette.
Palette behavior
The palette is clamped at zero before the exponent is applied. An offset below the amplitude therefore clips the troughs to black, so no pixel goes invalid.
Parameters
Custom
| Control | Type / default | What it does |
|---|---|---|
LengthLength |
number256 | Number of colours in the palette (the width of out_col). Blackout with Reductive at 0 adds its share on top of this. |
Input SmoothnessInputfiltertype |
menuInterpolate Pixels | Sampling filter the lookup uses on the input image: Nearest picks exact palette entries, Linear blends between neighbours. |
BlackoutBlackout |
number0 | Share of the palette (0 to 1) that fades to black at its start. Reductive decides whether that share is added to the length or taken from the colours; above 0 it enables the Soften parameters. |
ReductiveLensubtract |
number0 | How Blackout makes room: 0 extends the palette by the blackout share, 1 keeps Length and takes the blackout from the colours. |
Soften BlackBlacksoften |
number0.5 | Width of the fade from black into the palette, as a share of the blackout region. 0 is a hard edge, 1 fades across the whole region. |
Soften ExponentSoftenexponent |
number1 | Curve of the black fade: 1 is linear, higher values stay dark longer, below 1 brighten early. |
Soften ExtendSoftenextend |
menuZero/Hold | What the palette does inside the blackout region under the fade: Mirror reflects it, Zero/Hold holds the first colour, Repeat continues the cycle backwards. |
| pow(a + b*cos( 2PI * (c*t+d) ), e) | ||
a (Offset)A |
number0.5 | a (Offset) for red, green, blue: the base brightness the cosine swings around. |
b (Amplitude)B |
number0.5 | b (Amplitude) for red, green, blue: how far the cosine swings above and below a. Values above a clip to black at the troughs. |
c (Period)C |
number1 | c (Period) for red, green, blue: how many colour cycles fit along the palette. |
d (Phase)D |
number0 | d (Phase) for red, green, blue: shifts each channel's cycle; offsetting the three is what makes hues. Driven by Offset, Amplitude and Exponent while RGBD Mode is on. |
e (Exponent)E |
number1 | e (Exponent) for red, green, blue: gamma on each channel; above 1 deepens, below 1 lifts. |
RGBD ModeRgbdmode |
on / offoff | Drive the three d (Phase) values from Offset, Amplitude and Exponent instead of setting them by hand. Switching it on restores the shipped coefficients first. |
OffsetOffset |
number0 | RGBD Mode: phase of the red channel; green and blue follow from it. |
AmplitudeAmplitude |
number0.2 | RGBD Mode: phase spread from red to blue. 0 puts all three channels in phase (greys). |
ExponentExponent |
number1 | RGBD Mode: where green sits between red and blue in the spread: 1 halfway, higher values toward red. |
DefaultDefault |
button | Restore the shipped coefficients (a, b, c, d, e) and the RGBD Offset, Amplitude and Exponent. Parameters driven by an expression are left alone. |