diff --git a/app.py b/app.py index dbb5ec5..8d535d4 100644 --- a/app.py +++ b/app.py @@ -494,6 +494,25 @@ def fmt_time(s): return f"{s//3600}h{(s%3600)//60:02d}m" app.jinja_env.filters['fmt_time'] = fmt_time +_FRENCH_COLORS = { + 'blanc': '#ffffff', 'noir': '#111111', 'gris': '#6b7280', 'argent': '#9ca3af', + 'rouge': '#ef4444', 'rose': '#ec4899', 'fuchsia': '#d946ef', + 'orange': '#f97316', 'jaune': '#eab308', 'or': '#d97706', + 'vert': '#22c55e', 'olive': '#65a30d', 'emeraude': '#10b981', + 'bleu': '#3b82f6', 'marine': '#1e3a8a', 'ciel': '#38bdf8', 'cyan': '#06b6d4', + 'violet': '#8b5cf6', 'mauve': '#a855f7', 'indigo': '#6366f1', + 'marron': '#92400e', 'beige': '#d4b896', 'creme': '#fef3c7', + 'turquoise': '#14b8a6', 'or rose': '#fb7185', + 'transparent': 'rgba(200,200,200,0.3)', 'naturel': '#f5f0e8', + 'translucide': 'rgba(200,200,200,0.3)', +} + +def css_color(value): + if not value: + return value + return _FRENCH_COLORS.get(value.strip().lower(), value) +app.jinja_env.filters['css_color'] = css_color + # ─── Dashboard ──────────────────────────────────────────────────────────────── @app.route('/') diff --git a/templates/material_form.html b/templates/material_form.html index a91ac3e..a928f05 100644 --- a/templates/material_form.html +++ b/templates/material_form.html @@ -35,11 +35,34 @@ value="{{ material.brand if material else '' }}" placeholder="Bambu, eSUN, Polymaker…"> -