feat: Klick auf Farbswatch übernimmt Farbe als Ausgangsfarbe

- Sammlung (Verlauf/Favoriten/Schemata): Klick → Farbe setzen → Harmonien-Tab
- Harmonien: Klick auf Swatch → als neue Ausgangsfarbe, bleibt auf Harmonien
- switchTab() Hilfsfunktion in app.js

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ferdinand
2026-04-03 17:52:59 +02:00
parent 1753af0bfc
commit a58058b96c
3 changed files with 34 additions and 11 deletions

View File

@@ -4,6 +4,9 @@ const STORAGE_KEY = 'pigmento';
let editSchemaHandler = null;
export function setEditSchemaHandler(fn) { editSchemaHandler = fn; }
let swatchClickHandler = null;
export function setSwatchClickHandler(fn) { swatchClickHandler = fn; }
const HISTORY_MAX = 20;
function load() {
@@ -325,6 +328,11 @@ function makeSwatch(hsl) {
swatch.style.background = hex;
swatch.title = hex;
if (swatchClickHandler) {
swatch.style.cursor = 'pointer';
swatch.addEventListener('click', () => swatchClickHandler(hsl));
}
const label = document.createElement('span');
label.style.cssText = 'font-size:0.75rem;font-family:Poppins,sans-serif';
label.textContent = hex;