Merge pull request #12 from CrispyBaguette/darcula

More shades: darcula, gray gamma
This commit is contained in:
CrispyBaguette 2021-12-15 20:31:58 +01:00 committed by GitHub
commit 579876ffee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,10 @@ class Palette {
label: string;
constructor(label: string, colors: string[]) {
if (colors.length < 2) {
throw new Error("Palette requires at least two colors.");
}
this.label = label;
this.colors = colors;
}
@ -51,7 +55,40 @@ const grayScale2bits = new Palette("Gray Scale 2 bits", [
"ffffff",
]);
const palettes = [nord, monokai, grayScale1bit, grayScale2bits];
const grayScale2bitsGamma = new Palette("Gray, 4 shades, gamma-corrected", [
"000000",
"888888",
"b6b6b6",
"e0e0e0",
]);
const darcula = new Palette("Darcula", [
"000000",
"2B2B2B",
"323232",
"214283",
"555555",
"E74644",
"379C1A",
"5394ec",
"299999",
"808080",
"AE8ABE",
"DCC457",
"A9B7C6",
"EEEEEE",
]);
const palettes = [
nord,
monokai,
grayScale1bit,
grayScale2bits,
grayScale2bitsGamma,
darcula,
];
palettes.sort((a, b) => a.label.localeCompare(b.label));
export { palettes };
export default Palette;