Skip to content

Commit

Permalink
#14 #88 Add contrast map for brittni palette.
Browse files Browse the repository at this point in the history
  • Loading branch information
azurepolarbear committed Jun 2, 2024
1 parent 8d8e63e commit 723b5b6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/release-notes/v0.6.0-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ declare interface Palette {
* 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[] }
readonly CONTRAST_MAP: {
'#000000': string[],
'#FFFFFF': string[],
[HEX: string]: string[]
}
}
```

Expand Down
6 changes: 5 additions & 1 deletion src/main/color/palette/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ export interface Palette {
* 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[] }
readonly CONTRAST_MAP: {
'#000000': string[],
'#FFFFFF': string[],
[HEX: string]: string[]
}
}
19 changes: 18 additions & 1 deletion src/main/color/palette/palettes/miscellaneous/brittni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,32 @@ import {MISCELLANEOUS_PALETTES} from '../palette-maps';
*/
export const BRITTNI: Palette = {
NAME: 'brittni',

SOURCE: 'brittni',

IS_GRADIENT: false,

COLORS: [
_121212,
_0437F2,
_0FFF4F,
_7A00F5,
_FF6BB5
]
],

// TODO - Verify '#000000' does not contain '#FFFFFF'
// TODO - verify '#FFFFFF' does not contain '#000000'
// TODO - verify only keys values are palette hexes, '#000000, and '#FFFFFF'
// TODO - Unit Test - Verify AA.NORMAL Pass for all pairs
CONTRAST_MAP: {
'#000000': ['#0FFF4F', '#FF6BB5'],
'#FFFFFF': ['#121212', '#0437F2', '#7A00F5'],
'#121212': ['#FFFFFF', '#0FFF4F', '#FF6BB5'],
'#0437F2': ['#FFFFFF', '#0FFF4F'],
'#0FFF4F': ['#000000', '#121212', '#0437F2', '#7A00F5'],
'#7A00F5': ['#FFFFFF', '#0FFF4F'],
'#FF6BB5': ['#000000', '#121212']
}
};

MISCELLANEOUS_PALETTES.setUndefinedKey(BRITTNI.NAME, BRITTNI);

0 comments on commit 723b5b6

Please sign in to comment.