SPB Git

Repository Public

brands.py 11.5 KB 208 lines python

1#!/usr/bin/env python32# =============================================================================3#                  SP BOUCHER | SOFTWARE & RESEARCH4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# PROJECT METADATA8# -----------------------------------------------------------------------------9# Project          : KA Maps Engine10# File             : themes/tools/brands.py11# Description      : Écrit les quatre variantes de marque12#                    `themes/brands/<marque>.json`.13# Module           : themes14# Repository       : https://git.spboucher.ai/ka-maps-engine15# Created          : 2026-12-0116# Last Modified    : 2026-12-0117#18# =============================================================================19# AUTHOR & PROFESSIONAL AFFILIATION20# =============================================================================21#22# Author           : Simon-Pierre Boucher23# Position         : Professor of Finance24# Institution      : Université du Québec en Outaouais (UQO)25# Department       : Département des sciences administratives26# Organization     : SP Boucher27#28# Website          : https://spboucher.ai29# Git              : https://git.spboucher.ai30#31# =============================================================================32# OFFICIAL CONTACT DIRECTORY33# =============================================================================34#35# General          : info@spboucher.ai36# Professional     : contact@spboucher.ai37# Direct           : simon@spboucher.ai38# Research         : research@spboucher.ai39# Development      : dev@spboucher.ai40# Support          : support@spboucher.ai41# Security/Admin   : admin@spboucher.ai42# Notifications    : notifications@spboucher.ai43#44# Preferred Contact: support@spboucher.ai45#46# =============================================================================47# COPYRIGHT & INTELLECTUAL PROPERTY48# =============================================================================49#50# Copyright (c) 202651# Simon-Pierre Boucher52#53# All rights reserved where applicable.54#55# This file is governed by the applicable project license,56# copyright notices, institutional agreements and relevant law.57#58# Unless expressly authorized by the applicable license or59# rights holder, copying, redistribution, sublicensing,60# publication and commercial exploitation are not permitted.61#62# Existing third-party rights and notices remain unaffected.63#64# =============================================================================65# CONFIDENTIALITY & SECURITY66# =============================================================================67#68# Classification   : Public69# Distribution     : Public repository; use is governed by the project license70# Security Contact : admin@spboucher.ai71#72# Access to this source does not independently grant permission73# to redistribute or disclose confidential materials.74#75# Do not embed credentials, private keys, access tokens,76# certificates or confidential personal information.77#78# =============================================================================79# LICENSE & MAINTENANCE80# =============================================================================81#82# License          : None specified (no license file in this repository)83# Maintainer       : Simon-Pierre Boucher84# Technical Contact: dev@spboucher.ai85#86# =============================================================================87# END OF SP BOUCHER SOURCE HEADER88# =============================================================================8990"""Écrit les quatre variantes de marque `themes/brands/<marque>.json`.9192Une variante ne touche qu'aux entrées `accent*` de la palette, à la forme et aux genres de la93pastille, et AJOUTE ses rampes (`<marque>-…`) sans remplacer celles du thème : elle doit rester94juste sur les sept thèmes, clairs et sombre (voir docs/THEMES.md, « Variantes de marque »).95Les teintes viennent des feuilles de jetons des produits (lecture seule) :96  Lou-Ka    M4M64a:~/apps/lou-ka-v3/frontend/src/styles/tokens.css97  Immo-Ka   M4M64b:~/apps/immo-ka-v3/frontend/src/styles/tokens.css98  Vrai-Prix M3U96a:~/apps/vrai-prix-v3/src/styles/tokens.css99  Valo-Plex M3U96a:~/apps/valo-plex/src/app/globals.css, src/lib/couleurs.ts100"""101import json102import os103104OUT = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "brands")105106107def soft(c):108    return ["mix", c, "@land", 0.55]109110111BRANDS = {112    "louka": {113        "_description": "Lou-Ka, « la porte » : pastille au terracotta du chambranle, coins de porte (rayon 4) ; sélection = battant charbon cerné de terracotta ; vert forêt pour un bon loyer, ocre pour un loyer élevé.",114        "palette": {115            "accent": "#bf4c18", "accent-ink": "#ffffff", "accent-soft": soft("#bf4c18"),116            "accent-selected": "#181c1a", "accent-selected-ink": "#f7f6f0",117            "accent-good": "#0f5557", "accent-good-ink": "#ffffff", "accent-high": "#6b4200", "accent-high-ink": "#ffffff",118            "accent-seen": "#6c726c", "accent-seen-ink": "#ffffff", "accent-sold": "#181c1a", "accent-sold-ink": "#f7f6f0",119        },120        "markers": {"pill": {"radius": 4, "pointer": 5, "padding": [8, 5],121                             "kinds": {"rented": {"_note": "loué : charbon", "default": {"fill": "@accent-sold", "text": "@accent-sold-ink"}}}}},122        "scales": {123            "louka-loyer": {"_note": "loyer : séquentielle sauge → forêt (data-seq)", "type": "linear",124                            "stops": [[0, "#d9e8dd"], [0.25, "#a6c5b4"], [0.5, "#5e957d"], [0.75, "#2a624d"], [1, "#0f3328"]], "nullColor": "#8b928c99"},125            "louka-ecart": {"_note": "écart au marché : pétrole (sous) ↔ terracotta (au-dessus) (data-div)", "type": "linear",126                            "stops": [[-1, "#0b4650"], [-0.5, "#79aaa9"], [0, "#e9e8df"], [0.5, "#e2a077"], [1, "#b5521f"]], "nullColor": "#8b928c99"},127        },128    },129    "immoka": {130        "_description": "Immo-Ka, « la maison dont la porte s'ouvre » : pastille ardoise (la maison), sélection au rouge de la porte ; vert-de-gris sous l'intervalle, laiton au-dessus.",131        "palette": {132            "accent": "#2b4a63", "accent-ink": "#ffffff", "accent-soft": soft("#2b4a63"),133            "accent-selected": "#d12c37", "accent-selected-ink": "#ffffff",134            "accent-good": "#1a6a4c", "accent-good-ink": "#ffffff", "accent-high": "#96660f", "accent-high-ink": "#ffffff",135            "accent-seen": "#6e7076", "accent-seen-ink": "#ffffff", "accent-sold": "#1b1d22", "accent-sold-ink": "#f6f3ec",136        },137        "markers": {"pill": {"radius": 6, "pointer": 6,138                             "kinds": {"featured": {"_note": "en vedette : maison ardoise, porte rouge", "default": {"fill": "@accent", "text": "@accent-ink", "stroke": "#d12c37", "stroke-width": 2.25}}}}},139        "scales": {140            "immoka-prix": {"_note": "prix : séquentielle brume → ardoise (data-seq)", "type": "linear",141                            "stops": [[0, "#d8e3ec"], [0.25, "#aec4d4"], [0.5, "#7096b1"], [0.75, "#366685"], [1, "#173a52"]], "nullColor": "#8d909799"},142            "immoka-ecart": {"_note": "écart à l'intervalle : ardoise (sous) ↔ rouge porte (au-dessus) (data-div)", "type": "linear",143                             "stops": [[-1, "#143a57"], [-0.5, "#85a8bf"], [0, "#ebe8e0"], [0.5, "#e59c94"], [1, "#c2413f"]], "nullColor": "#8d909799"},144        },145    },146    "vraiprix": {147        "_description": "Vrai-Prix, « Aplomb » : outremer du plomb pour la valeur estimée, charbon pour les ventes réelles, ocre pour les prix demandés ; cinq classes de valeur fixes.",148        "palette": {149            "accent": "#2540a6", "accent-ink": "#ffffff", "accent-soft": soft("#2540a6"),150            "accent-selected": "#15171c", "accent-selected-ink": "#f3f2ed",151            "accent-good": "#1b7048", "accent-good-ink": "#ffffff", "accent-high": "#8c5800", "accent-high-ink": "#ffffff",152            "accent-seen": "#717278", "accent-seen-ink": "#ffffff", "accent-sold": "#15171c", "accent-sold-ink": "#f3f2ed",153            "accent-listing": "#8c5800", "accent-listing-ink": "#ffffff",154        },155        "markers": {156            "pill": {"radius": 11, "pointer": 7,157                     "kinds": {158                         "sale": {"_note": "vente réelle : charbon plein", "default": {"fill": "@accent-sold", "text": "@accent-sold-ink"}},159                         "listing": {"_note": "prix demandé : ocre, cerné de charbon", "default": {"fill": "@accent-listing", "text": "@accent-listing-ink", "stroke": "#15171c", "stroke-width": 1.25}}}},160            "point": {"radius": 5, "stroke-color": "#43464f", "stroke-width": 1},161        },162        "scales": {163            "vraiprix-classes": {"_note": "cinq classes de valeur fixes (map-class-1…5) ; les bornes viennent de l'application", "type": "steps",164                                 "stops": [[0, "#d6e3f5"], [0.2, "#a4bfea"], [0.4, "#668ddb"], [0.6, "#315bc4"], [0.8, "#1f3588"]], "nullColor": "#585b6466"},165        },166    },167    "valoplex": {168        "_description": "Valo-Plex, « l'Élévation » : brique pour l'immeuble étudié, encre pour les comparables, étiquette à angles droits comme une cote de plan ; échelle du prix par porte.",169        "palette": {170            "accent": "#a23b2a", "accent-ink": "#ffffff", "accent-soft": soft("#a23b2a"),171            "accent-selected": "#1c1b18", "accent-selected-ink": "#f3eee4",172            "accent-good": "#0d5458", "accent-good-ink": "#ffffff", "accent-high": "#986800", "accent-high-ink": "#ffffff",173            "accent-seen": "#736e64", "accent-seen-ink": "#ffffff", "accent-sold": "#1c1b18", "accent-sold-ink": "#f3eee4",174        },175        "markers": {176            "pill": {"radius": 1.5, "pointer": 4, "padding": [8, 5], "shadow-radius": 0, "shadow-offset-y": 0,177                     "kinds": {178                         "subject": {"_note": "immeuble étudié : brique, cerné d'encre", "default": {"fill": "@accent", "text": "@accent-ink", "stroke": "#1c1b18", "stroke-width": 2, "scale": 1.1}},179                         "comparable": {"_note": "comparable : encre", "default": {"fill": "@accent-sold", "text": "@accent-sold-ink"}}}},180            "columns": {"color": "@accent", "outline-color": "#1c1b1866"},181        },182        "scales": {183            "valoplex-porte": {"_note": "prix par porte, six classes à bornes fixes en dollars (BORNES_PORTE, TEINTES_PORTE)", "type": "steps",184                               "stops": [[0, "#e9dcbb"], [150000, "#dfb983"], [200000, "#d08f55"], [250000, "#b85c34"], [325000, "#8d3122"], [425000, "#4d1811"]],185                               "nullColor": "#b9b2a4"},186        },187        # Rampe de nuit (retour P6) : sur `midnight` la rampe de jour finissait en `#4d1811`, illisible sur le sol188        # sombre. De nuit le sens s'inverse comme pour les rampes du thème : le plus cher est le plus clair, clarté189        # strictement croissante, mêmes bornes.190        "themes": {191            "midnight": {192                "scales": {193                    "valoplex-porte": {"_note": "prix par porte, rampe de nuit : du brun sourd au laiton clair", "type": "steps",194                                       "stops": [[0, "#59392b"], [150000, "#834a2b"], [200000, "#a9612f"], [250000, "#c88645"], [325000, "#e2b56b"], [425000, "#f6e3ad"]],195                                       "nullColor": "#57524a"},196                },197            },198        },199    },200}201202if __name__ == "__main__":203    for name, doc in BRANDS.items():204        with open(os.path.join(OUT, f"{name}.json"), "w") as f:205            json.dump({"kastyle": 1, "brand": name, **doc}, f, ensure_ascii=False, indent=1)206            f.write("\n")207        print(name)208
Files main
Menu

Theme