Skip to content

Commit 89524b7

Browse files
committed
fix: update palette shades to include 950 and adjust error messages accordingly
1 parent 07c6bde commit 89524b7

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/consts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import type { ColorResultOptions } from './types.js';
22

33
export const initialOptions: Omit<ColorResultOptions, 'primaryColor'> = {
44
mainShade: 500,
5-
shades: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900],
5+
shades: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950],
66
};

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const checkParam = (palette: Palette): boolean => {
4040
}
4141
} else {
4242
if (shade && !initialOptions.shades.includes(shade)) {
43-
throw new PaletteError(`Main shade '${shade}' must be one of: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900.`);
43+
throw new PaletteError(`Main shade '${shade}' must be one of: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950.`);
4444
}
4545
}
4646

test/lib.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe('Palette Generation Tests', () => {
2020
'700': '#c78d00',
2121
'800': '#ab7600',
2222
'900': '#916000',
23+
'950': '#845500',
2324
DEFAULT: '#ffbd00',
2425
},
2526
});
@@ -72,6 +73,7 @@ describe('Palette Generation Tests', () => {
7273
'700': '#ab7600',
7374
'800': '#916000',
7475
'900': '#784b00',
76+
'950': '#6c4000',
7577
DEFAULT: '#ffbd00',
7678
},
7779
secondary: {

0 commit comments

Comments
 (0)