@@ -56,6 +57,7 @@
+
@@ -63,7 +65,7 @@
- Ochre · middle
#E2BB6D
- Slate blue · inner
#8AA8BA
- 100% intensity is the original palette. Hue and HSL lightness stay fixed; saturation stops at 100%. Gap compresses or expands the space between rings; scale zooms the whole mark about its center so the band spacing stays even at any size; thickness changes stroke width; rotation spins the whole mark; order reassigns which color sits on each ring. Readouts are the exact sRGB hex colors shown. Export downloads a standalone SVG with a white background circle.
+ 100% intensity is the original palette. Hue and HSL lightness stay fixed; saturation stops at 100%. Gap compresses or expands the space between rings; scale zooms the whole mark about its center so the band spacing stays even at any size; thickness changes stroke width; rotation spins the whole mark; order reassigns which color sits on each ring. Readouts are the exact sRGB hex colors shown. The white background circle in the preview is part of the mark. Export downloads it as a standalone SVG, or as a 2048px PNG that is transparent outside the circle.
diff --git a/public/color-rings.js b/public/color-rings.js
index 667d731..60dc08a 100644
--- a/public/color-rings.js
+++ b/public/color-rings.js
@@ -12,6 +12,7 @@
const order = document.querySelector('#order');
const theme = document.querySelector('#theme');
const exportButton = document.querySelector('#export');
+ const exportPngButton = document.querySelector('#export-png');
const ringsGroup = document.querySelector('#rings-group');
const ringsSvg = document.querySelector('.rings');
const bases = { clay: '#C98576', ochre: '#D6B779', slate: '#8FA7B5' };
@@ -24,6 +25,7 @@
const MIDDLE_R = 180;
const INNER_R = 110;
const BASE_GAP = 10;
+ const PNG_SIZE = 2048;
function toHsl(hex) {
const [r, g, b] = hex.match(/[a-f\d]{2}/gi).map(v => parseInt(v, 16) / 255);
@@ -103,9 +105,10 @@
theme.textContent = dark ? 'Light mode' : 'Dark mode';
}
- function exportSvg() {
- // Build a standalone SVG: current geometry and colors on a white
- // background circle, independent of the page's theme.
+ // Build a standalone SVG: current geometry and colors on a white
+ // background circle, independent of the page's theme. Size sets the
+ // intrinsic pixel dimensions; the viewBox stays 600 so geometry is shared.
+ function buildSvg(size = 600) {
const names = orderedNames();
const pct = Number(intensity.value);
const gapValue = Number(gap.value);
@@ -120,8 +123,8 @@
return ` `;
}).join('\n');
- const svg = `
-