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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user