| 100 | const GLOW_RED_GAIN = 0.9; |
| 101 | |
| 102 | export function nodeGlowBoost(r: number, g: number, b: number): number { |
| 103 | /* Blue that exceeds both red and green is a cool hub. Red that exceeds both |
| 104 | * green and blue is a warm leaf (the green cutoff keeps yellow/orange out |
| 105 | * of the red term so they are not boosted). */ |
| 106 | const blueness = Math.max(0, b - Math.max(r, g)); |
| 107 | const redness = Math.max(0, r - Math.max(g, b)); |
| 108 | return GLOW_BASE + blueness * GLOW_BLUE_GAIN + redness * GLOW_RED_GAIN; |
| 109 | } |
| 110 | |
| 111 | /* User-facing multipliers layered ON TOP of the adaptive scales above: the |
| 112 | * adaptive scale picks a sane default for the current density, the settings |