Skip to content

Commit 6ad7ae1

Browse files
authored
Merge pull request #306 from pathsim/feature/brand-trace-palette
Brand-driven plot trace palette
2 parents c41a80b + f37bc0d commit 6ad7ae1

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

src/lib/constants/brand.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,21 @@ export const BRAND = {
2121
/** Home link target (welcome modal). */
2222
home: import.meta.env.VITE_BRAND_HOME || 'https://pathsim.org',
2323
/** Simulation framework name (welcome tagline). */
24-
framework: import.meta.env.VITE_BRAND_FRAMEWORK || 'PathSim'
24+
framework: import.meta.env.VITE_BRAND_FRAMEWORK || 'PathSim',
25+
/**
26+
* Supplementary plot trace colors (used after trace 0, which takes the
27+
* accent). A re-branded build can override this so the palette doesn't clash
28+
* with its accent (e.g. a red-accent brand drops the leading red).
29+
*/
30+
tracePalette: [
31+
'#E57373', // Red
32+
'#81C784', // Green
33+
'#64B5F6', // Blue
34+
'#BA68C8', // Purple
35+
'#4DD0E1', // Cyan
36+
'#FFB74D', // Orange
37+
'#F06292', // Pink
38+
'#4DB6AC', // Teal
39+
'#90A4AE' // Grey
40+
]
2541
};

src/lib/plotting/core/constants.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import type { LineStyle, MarkerStyle } from './types';
6+
import { BRAND } from '$lib/constants/brand';
67

78
// ============================================================
89
// RENDER QUEUE CONFIGURATION
@@ -46,18 +47,8 @@ export function calculateGhostOpacity(ghostIndex: number, totalGhosts: number):
4647
// COLORS
4748
// ============================================================
4849

49-
/** Supplementary trace colors (after accent) */
50-
export const TRACE_COLORS = [
51-
'#E57373', // Red
52-
'#81C784', // Green
53-
'#64B5F6', // Blue
54-
'#BA68C8', // Purple
55-
'#4DD0E1', // Cyan
56-
'#FFB74D', // Orange
57-
'#F06292', // Pink
58-
'#4DB6AC', // Teal
59-
'#90A4AE' // Grey
60-
];
50+
/** Supplementary trace colors (after accent, which is trace 0), from the brand. */
51+
export const TRACE_COLORS = BRAND.tracePalette;
6152

6253
/**
6354
* Get trace color for a signal index

0 commit comments

Comments
 (0)