From 8d8e63e5068a0b456c6a45e7b83b8940474345f5 Mon Sep 17 00:00:00 2001 From: azurepolarbear Date: Sat, 1 Jun 2024 22:31:26 -0500 Subject: [PATCH] #14 #88 Add initial contrast map structure. --- docs/release-notes/v0.6.0-notes.md | 11 ++++++++++- src/main/color/palette/palette.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/v0.6.0-notes.md b/docs/release-notes/v0.6.0-notes.md index 8d81349..690e364 100644 --- a/docs/release-notes/v0.6.0-notes.md +++ b/docs/release-notes/v0.6.0-notes.md @@ -232,7 +232,16 @@ declare interface Palette { /** * The list of {@link PaletteColor} objects that compose the palette. */ - readonly COLORS: PaletteColor[] + readonly COLORS: PaletteColor[], + + /** + * A map of hex color strings to arrays of hex colors, + * where each color in the array passes the WCAG AA standard + * with normal and large size text when compared to the key.
+ * The only colors listed in this map should be the colors of the + * palette, black (#000000), and white (#FFFFFF). + */ + readonly CONTRAST_MAP: { [HEX: string]: string[] } } ``` diff --git a/src/main/color/palette/palette.ts b/src/main/color/palette/palette.ts index b58f1e1..620273d 100644 --- a/src/main/color/palette/palette.ts +++ b/src/main/color/palette/palette.ts @@ -40,5 +40,14 @@ export interface Palette { /** * The list of {@link PaletteColor} objects that compose the palette. */ - readonly COLORS: PaletteColor[] + readonly COLORS: PaletteColor[], + + /** + * A map of hex color strings to arrays of hex colors, + * where each color in the array passes the WCAG AA standard + * with normal and large size text when compared to the key.
+ * The only colors listed in this map should be the colors of the + * palette, black (#000000), and white (#FFFFFF). + */ + readonly CONTRAST_MAP: { [HEX: string]: string[] } }