Skip to content

Commit ccde8bc

Browse files
author
Matt Hobbs
committed
Added 10 new colour themes, "Volcanic" is fantastic!
1 parent 275a57a commit ccde8bc

File tree

4 files changed

+164
-0
lines changed

4 files changed

+164
-0
lines changed

index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,16 @@ <h1>Rendering Settings</h1>
737737
<option value="vintage">Vintage</option>
738738
<option value="tropical">Tropical</option>
739739
<option value="galaxy">Galaxy</option>
740+
<option value="lava">Lava</option>
741+
<option value="arctic">Arctic</option>
742+
<option value="sakura">Sakura</option>
743+
<option value="volcanic">Volcanic</option>
744+
<option value="mint">Mint</option>
745+
<option value="sunrise">Sunrise</option>
746+
<option value="steel">Steel</option>
747+
<option value="prism">Prism</option>
748+
<option value="mystic">Mystic</option>
749+
<option value="amber">Amber</option>
740750
</select>
741751
</div>
742752
</div>

static/js/core/config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ export const CONFIG = {
8282
'vintage',
8383
'tropical',
8484
'galaxy',
85+
'lava',
86+
'arctic',
87+
'sakura',
88+
'volcanic',
89+
'mint',
90+
'sunrise',
91+
'steel',
92+
'prism',
93+
'mystic',
94+
'amber',
8595
],
8696
},
8797
julia: {

static/js/fractals/utils.js

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,130 @@ export function computeColorForScheme(t, schemeIndex, out = null) {
326326
out[2] = Math.min(1.0, b * sparkle);
327327
return out;
328328
}
329+
case 28: {
330+
// lava - Molten lava (deep red to bright orange/yellow)
331+
// Lava: dark red to bright orange to yellow-white
332+
const phase1 = Math.min(t * 2.0, 1.0);
333+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
334+
335+
out[0] = 0.2 + phase1 * 0.6 + phase2 * 0.2;
336+
out[1] = 0.0 + phase1 * 0.4 + phase2 * 0.6;
337+
out[2] = 0.0 + phase1 * 0.1 + phase2 * 0.9;
338+
return out;
339+
}
340+
case 29: {
341+
// arctic - Cool arctic blues and whites
342+
// Arctic: deep blue to cyan to white
343+
const phase1 = Math.min(t * 2.0, 1.0);
344+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
345+
346+
out[0] = 0.1 + phase1 * 0.3 + phase2 * 0.6;
347+
out[1] = 0.2 + phase1 * 0.5 + phase2 * 0.3;
348+
out[2] = 0.4 + phase1 * 0.4 + phase2 * 0.6;
349+
return out;
350+
}
351+
case 30: {
352+
// sakura - Cherry blossom pinks
353+
// Sakura: soft pink to rose to white
354+
const phase1 = Math.min(t * 2.5, 1.0);
355+
const phase2 = Math.max(0.0, (t - 0.4) * 1.67);
356+
357+
out[0] = 0.3 + phase1 * 0.5 + phase2 * 0.2;
358+
out[1] = 0.2 + phase1 * 0.4 + phase2 * 0.4;
359+
out[2] = 0.25 + phase1 * 0.35 + phase2 * 0.4;
360+
return out;
361+
}
362+
case 31: {
363+
// volcanic - Dark volcanic colors (black, dark red, orange)
364+
// Volcanic: black to dark red to orange
365+
const darkBase = 0.05;
366+
const phase1 = Math.min(t * 3.0, 1.0);
367+
const phase2 = Math.max(0.0, (t - 0.33) * 1.5);
368+
369+
out[0] = darkBase + phase1 * 0.4 + phase2 * 0.55;
370+
out[1] = darkBase + phase1 * 0.1 + phase2 * 0.4;
371+
out[2] = darkBase + phase1 * 0.0 + phase2 * 0.2;
372+
return out;
373+
}
374+
case 32: {
375+
// mint - Fresh mint greens and teals
376+
// Mint: dark green to bright mint to cyan
377+
const phase1 = Math.min(t * 2.0, 1.0);
378+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
379+
380+
out[0] = 0.1 + phase1 * 0.2 + phase2 * 0.3;
381+
out[1] = 0.3 + phase1 * 0.5 + phase2 * 0.2;
382+
out[2] = 0.2 + phase1 * 0.4 + phase2 * 0.4;
383+
return out;
384+
}
385+
case 33: {
386+
// sunrise - Soft sunrise colors (pink, orange, yellow)
387+
// Sunrise: soft pink to orange to bright yellow
388+
const phase1 = Math.min(t * 2.0, 1.0);
389+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
390+
391+
out[0] = 0.4 + phase1 * 0.4 + phase2 * 0.2;
392+
out[1] = 0.3 + phase1 * 0.3 + phase2 * 0.4;
393+
out[2] = 0.35 + phase1 * 0.15 + phase2 * 0.5;
394+
return out;
395+
}
396+
case 34: {
397+
// steel - Metallic steel grays and blues
398+
// Steel: dark gray to blue-gray to silver
399+
const phase1 = Math.min(t * 2.0, 1.0);
400+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
401+
402+
out[0] = 0.2 + phase1 * 0.3 + phase2 * 0.3;
403+
out[1] = 0.25 + phase1 * 0.35 + phase2 * 0.25;
404+
out[2] = 0.3 + phase1 * 0.4 + phase2 * 0.3;
405+
return out;
406+
}
407+
case 35: {
408+
// prism - Inverted prism (dark base with bright complementary colors)
409+
// Prism: inverted rainbow - uses complementary colors with inverted brightness
410+
const hue = ((t * 360 * 1.5 + 180) % 360) / 360; // Shift 180 degrees for complementary colors
411+
412+
// Calculate complementary colors
413+
const r = 0.5 + 0.5 * Math.cos(hue * 6.28 + 0.0);
414+
const g = 0.5 + 0.5 * Math.cos(hue * 6.28 + 2.09);
415+
const b = 0.5 + 0.5 * Math.cos(hue * 6.28 + 4.18);
416+
417+
// Invert: dark base with bright complementary colors
418+
// Where rainbow is bright, prism is dark; where rainbow is dark, prism is bright
419+
out[0] = Math.max(0, Math.min(1, 0.15 + (1.0 - r) * 0.85));
420+
out[1] = Math.max(0, Math.min(1, 0.15 + (1.0 - g) * 0.85));
421+
out[2] = Math.max(0, Math.min(1, 0.15 + (1.0 - b) * 0.85));
422+
return out;
423+
}
424+
case 36: {
425+
// mystic - Deep purples and magentas with sparkles
426+
// Mystic: deep purple to magenta to bright pink with sparkle
427+
const phase1 = Math.min(t * 2.0, 1.0);
428+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
429+
430+
const r = 0.1 + phase1 * 0.5 + phase2 * 0.4;
431+
const g = 0.05 + phase1 * 0.2 + phase2 * 0.5;
432+
const b = 0.2 + phase1 * 0.6 + phase2 * 0.2;
433+
434+
// Add sparkle effect
435+
const sparkle = Math.sin(t * Math.PI * 10.0) * 0.2 + 0.8;
436+
437+
out[0] = Math.min(1.0, r * sparkle);
438+
out[1] = Math.min(1.0, g * sparkle);
439+
out[2] = Math.min(1.0, b * sparkle);
440+
return out;
441+
}
442+
case 37: {
443+
// amber - Warm amber, honey, brown tones
444+
// Amber: dark brown to amber to golden yellow
445+
const phase1 = Math.min(t * 2.0, 1.0);
446+
const phase2 = Math.max(0.0, (t - 0.5) * 2.0);
447+
448+
out[0] = 0.2 + phase1 * 0.5 + phase2 * 0.3;
449+
out[1] = 0.15 + phase1 * 0.4 + phase2 * 0.45;
450+
out[2] = 0.1 + phase1 * 0.2 + phase2 * 0.7;
451+
return out;
452+
}
329453
default: // classic (scheme == 0)
330454
out[0] = t * 0.5;
331455
out[1] = t;
@@ -641,6 +765,16 @@ export function getColorSchemeIndex(scheme) {
641765
'vintage',
642766
'tropical',
643767
'galaxy',
768+
'lava',
769+
'arctic',
770+
'sakura',
771+
'volcanic',
772+
'mint',
773+
'sunrise',
774+
'steel',
775+
'prism',
776+
'mystic',
777+
'amber',
644778
];
645779
return schemes.indexOf(scheme);
646780
}

static/js/ui/controls.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ export function setupUIControls(getters, setters, dependencies, callbacks) {
204204
vintage: 'Vintage',
205205
tropical: 'Tropical',
206206
galaxy: 'Galaxy',
207+
lava: 'Lava',
208+
arctic: 'Arctic',
209+
sakura: 'Sakura',
210+
volcanic: 'Volcanic',
211+
mint: 'Mint',
212+
sunrise: 'Sunrise',
213+
steel: 'Steel',
214+
prism: 'Prism',
215+
mystic: 'Mystic',
216+
amber: 'Amber',
207217
};
208218
return nameMap[scheme] || scheme.charAt(0).toUpperCase() + scheme.slice(1);
209219
};

0 commit comments

Comments
 (0)