Add full color palette table to debug panel

This commit is contained in:
Richard Zink committed 2026-10-07 11:56:13 +02:00
1 parent 45869e596d
commit 63d10c8b5a
1 file changed
+47 -17
+47 -17
View File
@@ -269,6 +269,7 @@
<div class="debug-row"><span class="libel">bgColor</span> <div class="swatch" id="dbg-v-bg"></div> <span class="hex" id="dbg-vh-bg">--</span></div>
<div class="debug-section">Theme table</div>
<div id="dbg-theme-table" class="theme-table"></div>
<div id="dbg-color-table" class="theme-table"></div>
</div>
<div id="info-panel">
<svg id="analog-clock" viewBox="0 0 280 280">
@@ -422,24 +423,35 @@ var effect = (VANTA.CLOUDS2 || VANTA.CLOUDS)({
// Read color palette from CSS variables
function getColors() {
var root = getComputedStyle(document.documentElement);
return {
void: root.getPropertyValue('--black').trim(),
panel: root.getPropertyValue('--dark').trim(),
raised: root.getPropertyValue('--gray-darker').trim(),
border: root.getPropertyValue('--gray-dark').trim(),
mid: root.getPropertyValue('--gray').trim(),
ash: root.getPropertyValue('--gray-light').trim(),
stone: root.getPropertyValue('--stone').trim(),
icon: root.getPropertyValue('--icon').trim(),
bone: root.getPropertyValue('--bone').trim(),
chalk: root.getPropertyValue('--chalk').trim(),
ember: root.getPropertyValue('--orange').trim(),
gold: root.getPropertyValue('--yellow').trim(),
blood: root.getPropertyValue('--red').trim(),
rust: root.getPropertyValue('--brown').trim(),
steel: root.getPropertyValue('--blue').trim(),
steelLight: root.getPropertyValue('--blue-light').trim()
var keys = [
'void', 'panel', 'raised', 'border', 'mid', 'ash',
'icon', 'stone', 'bone', 'chalk',
'ember', 'gold', 'blood', 'rust', 'rot', 'moss', 'steel', 'steelLight', 'violet'
];
var map = {
void: 'black',
panel: 'dark',
raised: 'gray-darker',
border: 'gray-dark',
mid: 'gray',
ash: 'gray-light',
ember: 'orange',
gold: 'yellow',
blood: 'red',
rust: 'brown',
rot: 'pink',
moss: 'green',
steel: 'blue',
steelLight: 'blue-light',
violet: 'purple'
};
var result = {};
for (var i = 0; i < keys.length; i++) {
var ashKey = keys[i];
var cssKey = map[ashKey] || ashKey;
result[ashKey] = root.getPropertyValue('--' + cssKey).trim();
}
return result;
}
function hexToInt(hex) {
@@ -1138,6 +1150,24 @@ var weatherThemes = {
tableHtml += '</div>';
}
document.getElementById('dbg-theme-table').innerHTML = tableHtml;
// Color palette table - all colors from the palette
var colorKeys = [
'black', 'dark', 'gray-darker', 'gray-dark', 'gray', 'gray-light',
'icon', 'stone', 'bone', 'chalk',
'orange', 'yellow', 'red', 'brown', 'pink', 'green', 'blue', 'blue-light', 'purple'
];
var colorHtml = '<div class="theme-table-header">Palette</div>';
for (var k = 0; k < colorKeys.length; k++) {
var ck = colorKeys[k];
var cv = ASH[ck] || root.getPropertyValue('--' + ck).trim();
colorHtml += '<div class="theme-table-row">' +
'<span class="theme-table-name">' + ck + '</span>' +
'<div class="theme-table-mini-swatch" style="background:' + cv + '"></div>' +
'<span class="theme-table-speed">' + cv + '</span>' +
'</div>';
}
document.getElementById('dbg-color-table').innerHTML = colorHtml;
}
function animate() {