Repository Public
1// =============================================================================2// SP BOUCHER | SOFTWARE & RESEARCH3// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// PROJECT METADATA7// -----------------------------------------------------------------------------8// Project : Immo-Ka Admin iOS9// File : ImmoKaAdmin/Design/Theme.swift10// Description : jetons de l'identité d'Immo-Ka, repris de son app publique11// : ardoise, chaux, charbon, laiton, rouge de la porte. Deux12// thèmes : clair (chaux) et sombre (nuit). Aucun dégradé13// décoratif.14// Module : ImmoKaAdmin15// Repository : https://git.spboucher.ai/immo-ka-admin-ios16// Project Website : https://www.immo-ka.com17// Created : 2026-11-3018// Last Modified : 2026-11-3019//20// =============================================================================21// AUTHOR & PROFESSIONAL AFFILIATION22// =============================================================================23//24// Author : Simon-Pierre Boucher25// Position : Professor of Finance26// Institution : Université du Québec en Outaouais (UQO)27// Department : Département des sciences administratives28// Organization : SP Boucher29//30// Website : https://spboucher.ai31// Git : https://git.spboucher.ai32//33// =============================================================================34// OFFICIAL CONTACT DIRECTORY35// =============================================================================36//37// General : info@spboucher.ai38// Professional : contact@spboucher.ai39// Direct : simon@spboucher.ai40// Research : research@spboucher.ai41// Development : dev@spboucher.ai42// Support : support@spboucher.ai43// Security/Admin : admin@spboucher.ai44// Notifications : notifications@spboucher.ai45//46// Preferred Contact: support@spboucher.ai47//48// =============================================================================49// COPYRIGHT & INTELLECTUAL PROPERTY50// =============================================================================51//52// Copyright (c) 202653// Simon-Pierre Boucher54//55// All rights reserved where applicable.56//57// This file is governed by the applicable project license,58// copyright notices, institutional agreements and relevant law.59//60// Unless expressly authorized by the applicable license or61// rights holder, copying, redistribution, sublicensing,62// publication and commercial exploitation are not permitted.63//64// Existing third-party rights and notices remain unaffected.65//66// =============================================================================67// CONFIDENTIALITY & SECURITY68// =============================================================================69//70// Classification : Public71// Distribution : Public repository; use is governed by the project license72// Security Contact : admin@spboucher.ai73//74// Access to this source does not independently grant permission75// to redistribute or disclose confidential materials.76//77// Do not embed credentials, private keys, access tokens,78// certificates or confidential personal information.79//80// =============================================================================81// LICENSE & MAINTENANCE82// =============================================================================83//84// License : None specified (no license file in this repository)85// Maintainer : Simon-Pierre Boucher86// Technical Contact: dev@spboucher.ai87//88// =============================================================================89// END OF SP BOUCHER SOURCE HEADER90// =============================================================================9192import SwiftUI93import UIKit9495extension Color {96 /// Couleur adaptative à partir de deux valeurs hexadécimales (clair, sombre).97 init(light: UInt32, dark: UInt32, lightAlpha: Double = 1, darkAlpha: Double = 1) {98 self.init(uiColor: UIColor { trait in99 let (hex, a) = trait.userInterfaceStyle == .dark ? (dark, darkAlpha) : (light, lightAlpha)100 return UIColor(red: CGFloat((hex >> 16) & 0xFF) / 255, green: CGFloat((hex >> 8) & 0xFF) / 255,101 blue: CGFloat(hex & 0xFF) / 255, alpha: a)102 })103 }104105 init(hex: UInt32, alpha: Double = 1) {106 self.init(.sRGB, red: Double((hex >> 16) & 0xFF) / 255, green: Double((hex >> 8) & 0xFF) / 255,107 blue: Double(hex & 0xFF) / 255, opacity: alpha)108 }109}110111enum Theme {112 // --- Palette de marque d'Immo-Ka (valeurs fixes) --------------------------------113 static let slate = Color(hex: 0x2B4A63) // ardoise : action principale114 static let chalk = Color(hex: 0xF6F3EC) // chaux : fond clair115 static let charcoal = Color(hex: 0x1B1D22) // charbon : texte116 static let brass = Color(hex: 0xD2AC62) // laiton : béquille de la porte117 static let nightBase = Color(hex: 0x14161A) // nuit : fond sombre118119 // --- Jetons sémantiques (clair / sombre), miroir de l'app publique d'Immo-Ka ---120 static let bg = Color(light: 0xF6F3EC, dark: 0x14161A)121 static let bg2 = Color(light: 0xEFEBE2, dark: 0x0F1114)122 static let surface = Color(light: 0xFFFEFC, dark: 0x1B1E23)123 static let surface2 = Color(light: 0xF1EEE6, dark: 0x23272D)124 static let surface3 = Color(light: 0xE6E2D8, dark: 0x2D3239)125 static let ink = Color(light: 0x1B1D22, dark: 0xF2EFE8)126 static let ink2 = Color(light: 0x474A52, dark: 0xBDBBB4)127 static let ink3 = Color(light: 0x5D6068, dark: 0x9DA0A8) // AA sur toutes les surfaces128 static let line = Color(light: 0xE4E0D6, dark: 0x282C32)129 static let line2 = Color(light: 0xCFCABE, dark: 0x3A3F47)130 static let lineControl = Color(light: 0x827E74, dark: 0x7C818B) // contour d'un contrôle : 3:1131132 /// Action principale : ardoise ; éclaircie en thème sombre pour rester lisible.133 static let brand = Color(light: 0x2B4A63, dark: 0x9DBEDA)134 static let brandStrong = Color(light: 0x1D3549, dark: 0xB9D2E6)135 static let brandInk = Color(light: 0xFFFFFF, dark: 0x10161C)136 static let brandSoft = Color(light: 0xDEE6EC, dark: 0x1D2A36)137138 /// Rouge de la porte d'Immo-Ka (pastilles de compte) ; `accentUI` porte du blanc.139 static let accent = Color(light: 0xD12C37, dark: 0xD8363F)140 static let accentUI = Color(light: 0xB5252F, dark: 0xC0323A)141 static let accentSoft = Color(light: 0xFAE1DF, dark: 0x3A1C1E)142143 // --- États : toujours doublés d'un glyphe et d'un libellé144 static let good = Color(light: 0x2C6A4C, dark: 0x8FC7A8)145 static let goodSoft = Color(light: 0xDCEBE2, dark: 0x1C3127)146 static let high = Color(light: 0x855608, dark: 0xD9A85C)147 static let highSoft = Color(light: 0xF3E7CF, dark: 0x33291A)148 static let bad = Color(light: 0xA3312A, dark: 0xEC8F84)149 static let badSoft = Color(light: 0xF6DFDB, dark: 0x3A211D)150151 // rayons : étiquette 4 · contrôle 8 · surface 10152 static let radius: CGFloat = 10153 static let radiusSmall: CGFloat = 8154 static let radiusTag: CGFloat = 4155}156157extension Font {158 /// Chiffres et libellés d'interface en grand : SF Pro.159 static func display(_ size: CGFloat, weight: Font.Weight = .semibold) -> Font {160 .system(size: size, weight: weight, design: .default)161 }162163 /// Titres éditoriaux : New York (serif système), romain, graisse 500.164 static func editorial(_ size: CGFloat, weight: Font.Weight = .medium) -> Font {165 .system(size: size, weight: weight, design: .serif)166 }167}168169extension View {170 /// Carte : surface, filet, coins mesurés.171 func cardStyle(padding: CGFloat = 18, radius: CGFloat = Theme.radius) -> some View {172 self.padding(padding)173 .background(Theme.surface, in: RoundedRectangle(cornerRadius: radius, style: .continuous))174 .overlay(RoundedRectangle(cornerRadius: radius, style: .continuous).strokeBorder(Theme.line, lineWidth: 1))175 }176177 /// Sur-titre en petites capitales espacées.178 func eyebrowStyle() -> some View {179 self.font(.caption2.weight(.semibold)).tracking(1.2).textCase(.uppercase).foregroundStyle(Theme.ink3)180 }181182 /// Chiffres tabulaires.183 func num() -> some View { self.monospacedDigit() }184185 /// Fond opaque d'un contrôle posé sur la carte ou sur une photo (pas de verre décoratif).186 func solidControl<S: InsettableShape>(_ shape: S) -> some View {187 self.background(Theme.surface, in: shape)188 .overlay(shape.strokeBorder(Theme.line2, lineWidth: 1))189 .shadow(color: .black.opacity(0.10), radius: 5, y: 2)190 }191}192