[chroma-js] fix valid interpolation modes

Not all `ColorSpaces` are valid for interpolation, so i created the `InterpolationMode` type, which has valid modes for interpolating between.
This commit is contained in:
alecmolloy
2018-12-11 19:48:57 +00:00
parent a6097e9dc2
commit 07b487166c
+3 -1
View File
@@ -21,6 +21,8 @@ declare namespace chroma {
gl: [number, number, number, number];
}
type InterpolationMode = "rgb" | "hsl" | "hsv" | "hsi" | "lab" | "lch" | "hcl"
interface ChromaStatic {
/**
* Creates a color from a string representation (as supported in CSS).
@@ -311,7 +313,7 @@ declare namespace chroma {
domain(d?: number[], n?: number, mode?: string): this;
mode(mode: keyof ColorSpaces): this;
mode(mode: InterpolationMode): this;
gamma(g: number): this;