omni-color 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -10
- package/dist/index.d.ts +114 -90
- package/dist/index.js +2415 -2394
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -805,22 +805,22 @@ new Color('#ff7f50').getHarmonyColors('TRIADIC').map((color) => color.toHex());
|
|
|
805
805
|
|
|
806
806
|
#### `getColorSwatch(options?: ColorSwatchOptions): ColorSwatch`
|
|
807
807
|
|
|
808
|
-
- <ins>Returns</ins> a [`ColorSwatch`](#types-color-swatch) of lighter and darker variants keyed `100`–`900`, reporting the
|
|
808
|
+
- <ins>Returns</ins> a [`ColorSwatch`](#types-color-swatch) of lighter and darker variants keyed `100`–`900`, reporting the base shade via `baseShade`. When `extended` is `true`, returns instead an [`ExtendedColorSwatch`](#types-extended-color-swatch) with half-shades `50`–`950` added without moving the base color to a half-shade; otherwise, [`BaseColorSwatch`](#types-base-color-swatch).
|
|
809
809
|
- <ins>Inputs</ins>:
|
|
810
810
|
- `options` (optional) - `ColorSwatchOptions`:
|
|
811
|
-
- `centerOn500` - force the original color onto the `500`
|
|
812
|
-
- `extended` - set to `true` to include midpoint
|
|
811
|
+
- `centerOn500` - force the original color onto the `500` shade instead of dynamically anchoring by lightness (default is `false`).
|
|
812
|
+
- `extended` - set to `true` to include midpoint shades `50`–`950` and return an [`ExtendedColorSwatch`](#types-extended-color-swatch). Defaults to `false` (base shades only).
|
|
813
813
|
|
|
814
814
|
```ts
|
|
815
815
|
const green = new Color('green');
|
|
816
816
|
const swatch = green.getColorSwatch({ centerOn500: true });
|
|
817
|
-
swatch.
|
|
817
|
+
swatch.baseShade; // 500
|
|
818
818
|
swatch[500].equals(green); // true
|
|
819
819
|
swatch[100].toHex(); // lightest
|
|
820
820
|
swatch[900].toHex(); // darkest
|
|
821
821
|
|
|
822
822
|
const extendedSwatch = new Color('#008000').getColorSwatch({ extended: true });
|
|
823
|
-
extendedSwatch.
|
|
823
|
+
extendedSwatch.baseShade; // 700
|
|
824
824
|
extendedSwatch[700].equals('#008000'); // true
|
|
825
825
|
extendedSwatch[50].toHex(); // lightest
|
|
826
826
|
extendedSwatch[500].toHex(); // middle
|
|
@@ -829,7 +829,9 @@ extendedSwatch[950].toHex(); // darkest
|
|
|
829
829
|
|
|
830
830
|
#### `getColorPalette(harmony = 'COMPLEMENTARY', options?: GenerateColorPaletteOptions): ColorPalette`
|
|
831
831
|
|
|
832
|
-
- <ins>Returns</ins> a complete [`ColorPalette`](#types-color-palette) containing the primary swatch, secondary swatches from the chosen harmony, neutral/tinted neutrals, and semantic swatches (`info`, `positive`, `negative`, `warning`, `special`).
|
|
832
|
+
- <ins>Returns</ins> a complete [`ColorPalette`](#types-color-palette) containing the primary swatch, secondary swatches from the chosen harmony, neutral/tinted neutrals, secondary tinted neutrals, and semantic swatches (`info`, `positive`, `negative`, `warning`, `special`).
|
|
833
|
+
- `palette.tintedNeutrals` is tinted toward the main color.
|
|
834
|
+
- `palette.secondaryTintedNeutrals` is an array of tinted neutral swatches for the secondary colors. It always matches `palette.secondaryColors` by index: `palette.secondaryTintedNeutrals[0]` is for `palette.secondaryColors[0]`, `palette.secondaryTintedNeutrals[1]` is for `palette.secondaryColors[1]`, and so on.
|
|
833
835
|
- <ins>Inputs</ins>:
|
|
834
836
|
- `harmony` (optional) - [`ColorHarmony`](#types-color-harmony) used to generate secondary colors (defaults to `'COMPLEMENTARY'`).
|
|
835
837
|
- `options` (optional) - `GenerateColorPaletteOptions`:
|
|
@@ -843,7 +845,9 @@ const palette = new Color('#ff7f50').getColorPalette('ANALOGOUS', {
|
|
|
843
845
|
semanticHarmonization: { huePull: 0.35 },
|
|
844
846
|
swatchOptions: { centerOn500: false },
|
|
845
847
|
});
|
|
846
|
-
palette.info[500].toHex(); // '#
|
|
848
|
+
palette.info[500].toHex(); // '#9d3fd3'
|
|
849
|
+
palette.secondaryColors[0][500].toHex(); // '#f92354'
|
|
850
|
+
palette.secondaryTintedNeutrals[0][500].toHex(); // '#8c7d7f' - for secondaryColors[0]
|
|
847
851
|
```
|
|
848
852
|
|
|
849
853
|
### Readability and Accessibility
|
|
@@ -1001,10 +1005,12 @@ bestSwatchBackground.toHex(); // '#301308'
|
|
|
1001
1005
|
- <span id="types-color-oklch">`ColorOKLCH`</span> - OKLCH color space with lightness, chroma, and hue. `{ l: number; c: number; h: number }` where `l` is a number between 0 and 1 (lightness), `c` is a number representing chroma (typically 0–0.4), and `h` is a number between 0 and 360 (hue in degrees).
|
|
1002
1006
|
- <span id="types-color-space">`ColorSpace`</span> - supported color spaces for `Color.toColorString()`: `"SRGB" | "DISPLAY-P3" | "REC2020"`.
|
|
1003
1007
|
- <span id="types-color-temperature-label">`ColorTemperatureLabel`</span> - color temperature options: `"Candlelight" | "Incandescent lamp" | "Halogen lamp" | "Fluorescent lamp" | "Daylight" | "Cloudy sky" | "Shade" | "Blue sky"`
|
|
1004
|
-
- <span id="types-base-color-swatch">`
|
|
1005
|
-
- <span id="types-extended-color-swatch">`
|
|
1008
|
+
- <span id="types-base-color-swatch-shade">`BaseColorSwatchShade`</span> - a base swatch shade key: `100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900`.
|
|
1009
|
+
- <span id="types-extended-color-swatch-shade">`ExtendedColorSwatchShade`</span> - an extended swatch shade key: [`BaseColorSwatchShade`](#types-base-color-swatch-shade) plus `50 | 150 | 250 | 350 | 450 | 550 | 650 | 750 | 850 | 950`.
|
|
1010
|
+
- <span id="types-base-color-swatch">`BaseColorSwatch`</span> - a swatch representing shades of the same color from 100 to 900 with `baseShade` identifying the original color shade. `100` is the lightest shade and `900` is the darkest shade.
|
|
1011
|
+
- <span id="types-extended-color-swatch">`ExtendedColorSwatch`</span> - same as a [`BaseColorSwatch`](#types-base-color-swatch) but includes half-shades at 50, 100, 150, ..., 950.
|
|
1006
1012
|
- <span id="types-color-swatch">`ColorSwatch`</span> - `BaseColorSwatch | ExtendedColorSwatch`.
|
|
1007
|
-
- <span id="types-color-palette">`ColorPalette`</span> - a collection of [`ColorSwatch`](#types-color-swatch)es representing a color palette for a specified [`ColorHarmony`](#types-color-harmony). Includes a `primary` swatch for the main (base) color, `secondaryColors` swatches depending on the color harmony,
|
|
1013
|
+
- <span id="types-color-palette">`ColorPalette`</span> - a collection of [`ColorSwatch`](#types-color-swatch)es representing a color palette for a specified [`ColorHarmony`](#types-color-harmony). Includes a `primary` swatch for the main (base) color, `secondaryColors` swatches depending on the color harmony, swatches for `neutrals`, `tintedNeutrals` (neutrals slightly tinted toward the main color), `secondaryTintedNeutrals` (an array of tinted neutral swatches that matches `secondaryColors` by index), and swatches for semantic colors `info`, `negative`, `positive`, `special`, and `warning`.
|
|
1008
1014
|
- <span id="types-color-harmony">`ColorHarmony`</span> - a type of color harmony to generate [`ColorPalette`](#types-color-palette): `"COMPLEMENTARY" | "SPLIT_COMPLEMENTARY" | "TRIADIC" | "SQUARE" | "TETRADIC" | "ANALOGOUS" | "MONOCHROMATIC"`
|
|
1009
1015
|
- <span id="types-grayscale-handling-mode">`GrayscaleHandlingMode`</span> - how hue rotations handle grayscale inputs: `"SPIN_LIGHTNESS" | "IGNORE"`.
|
|
1010
1016
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
type CaseInsensitive<T extends string> = T | Lowercase<T> | Uppercase<T> | Capitalize<Lowercase<T>>;
|
|
2
2
|
|
|
3
|
+
type ColorHex = `#${string}`;
|
|
4
|
+
interface ColorRGB {
|
|
5
|
+
r: number;
|
|
6
|
+
g: number;
|
|
7
|
+
b: number;
|
|
8
|
+
}
|
|
9
|
+
interface ColorRGBA extends ColorRGB {
|
|
10
|
+
a: number;
|
|
11
|
+
}
|
|
12
|
+
interface ColorHSL {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
l: number;
|
|
16
|
+
}
|
|
17
|
+
interface ColorHSLA extends ColorHSL {
|
|
18
|
+
a: number;
|
|
19
|
+
}
|
|
20
|
+
interface ColorHSV {
|
|
21
|
+
h: number;
|
|
22
|
+
s: number;
|
|
23
|
+
v: number;
|
|
24
|
+
}
|
|
25
|
+
interface ColorHSVA extends ColorHSV {
|
|
26
|
+
a: number;
|
|
27
|
+
}
|
|
28
|
+
interface ColorHWB {
|
|
29
|
+
h: number;
|
|
30
|
+
w: number;
|
|
31
|
+
b: number;
|
|
32
|
+
}
|
|
33
|
+
interface ColorHWBA extends ColorHWB {
|
|
34
|
+
a: number;
|
|
35
|
+
}
|
|
36
|
+
interface ColorCMYK {
|
|
37
|
+
c: number;
|
|
38
|
+
m: number;
|
|
39
|
+
y: number;
|
|
40
|
+
k: number;
|
|
41
|
+
}
|
|
42
|
+
interface ColorLAB {
|
|
43
|
+
l: number;
|
|
44
|
+
a: number;
|
|
45
|
+
b: number;
|
|
46
|
+
format?: CaseInsensitive<'LAB'>;
|
|
47
|
+
}
|
|
48
|
+
interface ColorOKLAB {
|
|
49
|
+
l: number;
|
|
50
|
+
a: number;
|
|
51
|
+
b: number;
|
|
52
|
+
format?: CaseInsensitive<'OKLAB'>;
|
|
53
|
+
}
|
|
54
|
+
interface ColorLCH {
|
|
55
|
+
l: number;
|
|
56
|
+
c: number;
|
|
57
|
+
h: number;
|
|
58
|
+
format?: CaseInsensitive<'LCH'>;
|
|
59
|
+
}
|
|
60
|
+
interface ColorOKLCH {
|
|
61
|
+
l: number;
|
|
62
|
+
c: number;
|
|
63
|
+
h: number;
|
|
64
|
+
format?: CaseInsensitive<'OKLCH'>;
|
|
65
|
+
}
|
|
66
|
+
type ColorFormat = ColorHex | ColorRGB | ColorRGBA | ColorHSL | ColorHSLA | ColorHSV | ColorHSVA | ColorHWB | ColorHWBA | ColorCMYK | ColorLAB | ColorOKLAB | ColorLCH | ColorOKLCH;
|
|
67
|
+
|
|
3
68
|
declare const GRAYSCALE_HANDLING_MODES: readonly ["SPIN_LIGHTNESS", "IGNORE"];
|
|
4
69
|
type GrayscaleHandlingMode = (typeof GRAYSCALE_HANDLING_MODES)[number];
|
|
5
70
|
declare const COLOR_HARMONIES: readonly ["COMPLEMENTARY", "SPLIT_COMPLEMENTARY", "TRIADIC", "SQUARE", "TETRADIC", "ANALOGOUS", "MONOCHROMATIC"];
|
|
@@ -7,9 +72,22 @@ type ColorHarmony = (typeof COLOR_HARMONIES)[number];
|
|
|
7
72
|
interface ColorHarmonyOptions {
|
|
8
73
|
grayscaleHandlingMode?: CaseInsensitive<GrayscaleHandlingMode>;
|
|
9
74
|
}
|
|
75
|
+
type TetradicHarmonyDirection = 'CLOCKWISE' | 'COUNTERCLOCKWISE';
|
|
76
|
+
interface TetradicHarmonyOptions extends ColorHarmonyOptions {
|
|
77
|
+
/**
|
|
78
|
+
* Direction used for tetradic hue spins.
|
|
79
|
+
*
|
|
80
|
+
* - CLOCKWISE: +60, +180, +240
|
|
81
|
+
* - COUNTERCLOCKWISE: -60, -180, -240
|
|
82
|
+
*
|
|
83
|
+
* Defaults to CLOCKWISE.
|
|
84
|
+
*/
|
|
85
|
+
direction?: CaseInsensitive<TetradicHarmonyDirection>;
|
|
86
|
+
}
|
|
10
87
|
|
|
11
|
-
type
|
|
12
|
-
|
|
88
|
+
type BaseColorSwatchShade = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
89
|
+
type ExtendedColorSwatchShade = BaseColorSwatchShade | 50 | 150 | 250 | 350 | 450 | 550 | 650 | 750 | 850 | 950;
|
|
90
|
+
interface BaseColorSwatchShades {
|
|
13
91
|
100: Color;
|
|
14
92
|
200: Color;
|
|
15
93
|
300: Color;
|
|
@@ -20,11 +98,11 @@ interface BaseColorSwatchStops {
|
|
|
20
98
|
800: Color;
|
|
21
99
|
900: Color;
|
|
22
100
|
}
|
|
23
|
-
interface BaseColorSwatch extends
|
|
24
|
-
type: '
|
|
25
|
-
|
|
101
|
+
interface BaseColorSwatch extends BaseColorSwatchShades {
|
|
102
|
+
type: 'BASE';
|
|
103
|
+
baseShade: BaseColorSwatchShade;
|
|
26
104
|
}
|
|
27
|
-
interface
|
|
105
|
+
interface ExtendedColorSwatchShades extends BaseColorSwatchShades {
|
|
28
106
|
50: Color;
|
|
29
107
|
150: Color;
|
|
30
108
|
250: Color;
|
|
@@ -36,28 +114,40 @@ interface ExtendedColorSwatchStops extends BaseColorSwatchStops {
|
|
|
36
114
|
850: Color;
|
|
37
115
|
950: Color;
|
|
38
116
|
}
|
|
39
|
-
interface ExtendedColorSwatch extends
|
|
117
|
+
interface ExtendedColorSwatch extends ExtendedColorSwatchShades {
|
|
40
118
|
type: 'EXTENDED';
|
|
41
|
-
|
|
119
|
+
baseShade: BaseColorSwatchShade;
|
|
42
120
|
}
|
|
43
121
|
type ColorSwatch = BaseColorSwatch | ExtendedColorSwatch;
|
|
44
122
|
interface ColorSwatchOptions {
|
|
45
123
|
/**
|
|
46
|
-
* Include half-
|
|
124
|
+
* Include half-shades (`50`, `150`, …, `950`) interpolated between the base swatch shades.
|
|
47
125
|
*/
|
|
48
126
|
extended?: boolean;
|
|
49
127
|
/**
|
|
50
|
-
* Center the provided color on the 500 swatch
|
|
128
|
+
* Center the provided color on the 500 swatch shade instead of positioning it dynamically.
|
|
51
129
|
*/
|
|
52
130
|
centerOn500?: boolean;
|
|
53
131
|
}
|
|
54
132
|
|
|
55
133
|
interface ColorPalette {
|
|
134
|
+
/** The main color's swatch. */
|
|
56
135
|
primary: ColorSwatch;
|
|
136
|
+
/** Swatches generated from the selected harmony, excluding the main color. */
|
|
57
137
|
secondaryColors: ColorSwatch[];
|
|
138
|
+
/** Neutral swatch harmonized to the main color's lightness. */
|
|
58
139
|
neutrals: ColorSwatch;
|
|
140
|
+
/** Neutral swatch harmonized to the main color's lightness and slightly tinted toward the main color. */
|
|
59
141
|
tintedNeutrals: ColorSwatch;
|
|
60
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Tinted neutral swatches for each secondary color.
|
|
144
|
+
*
|
|
145
|
+
* This array always matches `secondaryColors` by index: `secondaryTintedNeutrals[0]`
|
|
146
|
+
* is the tinted neutral swatch for `secondaryColors[0]`, `secondaryTintedNeutrals[1]`
|
|
147
|
+
* is the tinted neutral swatch for `secondaryColors[1]`, and so on.
|
|
148
|
+
*/
|
|
149
|
+
secondaryTintedNeutrals: ColorSwatch[];
|
|
150
|
+
black: Color;
|
|
61
151
|
white: Color;
|
|
62
152
|
info: ColorSwatch;
|
|
63
153
|
negative: ColorSwatch;
|
|
@@ -79,76 +169,6 @@ interface GenerateColorPaletteOptions {
|
|
|
79
169
|
swatchOptions?: ColorSwatchOptions;
|
|
80
170
|
}
|
|
81
171
|
|
|
82
|
-
declare const COLOR_BRAND: unique symbol;
|
|
83
|
-
interface ColorBrand {
|
|
84
|
-
readonly [COLOR_BRAND]: true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
type ColorHex = `#${string}`;
|
|
88
|
-
interface ColorRGB {
|
|
89
|
-
r: number;
|
|
90
|
-
g: number;
|
|
91
|
-
b: number;
|
|
92
|
-
}
|
|
93
|
-
interface ColorRGBA extends ColorRGB {
|
|
94
|
-
a: number;
|
|
95
|
-
}
|
|
96
|
-
interface ColorHSL {
|
|
97
|
-
h: number;
|
|
98
|
-
s: number;
|
|
99
|
-
l: number;
|
|
100
|
-
}
|
|
101
|
-
interface ColorHSLA extends ColorHSL {
|
|
102
|
-
a: number;
|
|
103
|
-
}
|
|
104
|
-
interface ColorHSV {
|
|
105
|
-
h: number;
|
|
106
|
-
s: number;
|
|
107
|
-
v: number;
|
|
108
|
-
}
|
|
109
|
-
interface ColorHSVA extends ColorHSV {
|
|
110
|
-
a: number;
|
|
111
|
-
}
|
|
112
|
-
interface ColorHWB {
|
|
113
|
-
h: number;
|
|
114
|
-
w: number;
|
|
115
|
-
b: number;
|
|
116
|
-
}
|
|
117
|
-
interface ColorHWBA extends ColorHWB {
|
|
118
|
-
a: number;
|
|
119
|
-
}
|
|
120
|
-
interface ColorCMYK {
|
|
121
|
-
c: number;
|
|
122
|
-
m: number;
|
|
123
|
-
y: number;
|
|
124
|
-
k: number;
|
|
125
|
-
}
|
|
126
|
-
interface ColorLAB {
|
|
127
|
-
l: number;
|
|
128
|
-
a: number;
|
|
129
|
-
b: number;
|
|
130
|
-
format?: CaseInsensitive<'LAB'>;
|
|
131
|
-
}
|
|
132
|
-
interface ColorOKLAB {
|
|
133
|
-
l: number;
|
|
134
|
-
a: number;
|
|
135
|
-
b: number;
|
|
136
|
-
format?: CaseInsensitive<'OKLAB'>;
|
|
137
|
-
}
|
|
138
|
-
interface ColorLCH {
|
|
139
|
-
l: number;
|
|
140
|
-
c: number;
|
|
141
|
-
h: number;
|
|
142
|
-
format?: CaseInsensitive<'LCH'>;
|
|
143
|
-
}
|
|
144
|
-
interface ColorOKLCH {
|
|
145
|
-
l: number;
|
|
146
|
-
c: number;
|
|
147
|
-
h: number;
|
|
148
|
-
format?: CaseInsensitive<'OKLCH'>;
|
|
149
|
-
}
|
|
150
|
-
type ColorFormat = ColorHex | ColorRGB | ColorRGBA | ColorHSL | ColorHSLA | ColorHSV | ColorHSVA | ColorHWB | ColorHWBA | ColorCMYK | ColorLAB | ColorOKLAB | ColorLCH | ColorOKLCH;
|
|
151
|
-
|
|
152
172
|
type ColorSpace = 'SRGB' | 'DISPLAY-P3' | 'REC2020';
|
|
153
173
|
interface ColorStringOptions {
|
|
154
174
|
space?: CaseInsensitive<ColorSpace>;
|
|
@@ -459,6 +479,10 @@ interface IsColorDarkYIQOptions {
|
|
|
459
479
|
}
|
|
460
480
|
type IsColorDarkOptions = IsColorDarkWCAGOptions | IsColorDarkYIQOptions;
|
|
461
481
|
|
|
482
|
+
declare const COLOR_BRAND: unique symbol;
|
|
483
|
+
interface ColorBrand {
|
|
484
|
+
readonly [COLOR_BRAND]: true;
|
|
485
|
+
}
|
|
462
486
|
type ValidColorInputFormat = Color | ColorFormat | string;
|
|
463
487
|
/**
|
|
464
488
|
* The base omni-color object.
|
|
@@ -907,7 +931,7 @@ declare class Color implements ColorBrand {
|
|
|
907
931
|
* d.toHex(); // '#0000ff'
|
|
908
932
|
* ```
|
|
909
933
|
*/
|
|
910
|
-
getTetradicHarmonyColors(options?:
|
|
934
|
+
getTetradicHarmonyColors(options?: TetradicHarmonyOptions): [Color, Color, Color, Color];
|
|
911
935
|
/**
|
|
912
936
|
* Get the analogous harmony for the color. These are colors adjacent to
|
|
913
937
|
* the base hue, offering subtle contrast.
|
|
@@ -958,26 +982,26 @@ declare class Color implements ColorBrand {
|
|
|
958
982
|
/**
|
|
959
983
|
* Returns a {@link ColorSwatch} of lighter and darker variants of the color. The
|
|
960
984
|
* swatch has keys `100`–`900` and, by default, anchors the original color on the
|
|
961
|
-
*
|
|
985
|
+
* shade that best matches its lightness (reported via the `baseShade` property).
|
|
962
986
|
* Lower numbers are lighter and higher numbers are darker, with black and white
|
|
963
987
|
* always centered on `500`. Passing `{ centerOn500: true }` forces the original
|
|
964
|
-
* color onto the `500`
|
|
965
|
-
* `{ extended: true }` adds midpoint
|
|
988
|
+
* color onto the `500` shade regardless of its brightness. Passing
|
|
989
|
+
* `{ extended: true }` adds midpoint shades (`50`, `150`, `250`, ... `950`) that
|
|
966
990
|
* are interpolated between the base swatch colors while still anchoring the
|
|
967
|
-
* base color on a `100`–`900`
|
|
991
|
+
* base color on a `100`–`900` shade.
|
|
968
992
|
*
|
|
969
|
-
* @param options - Optional {@link ColorSwatchOptions} for requesting the extended swatch or customizing the
|
|
993
|
+
* @param options - Optional {@link ColorSwatchOptions} for requesting the extended swatch or customizing the base shade.
|
|
970
994
|
* @returns A {@link ColorSwatch} containing lighter and darker {@link Color}s ranging from lightest to darkest.
|
|
971
995
|
*
|
|
972
996
|
* @example
|
|
973
997
|
* ```ts
|
|
974
998
|
* const swatch = new Color('#ff0000').getColorSwatch();
|
|
975
|
-
* swatch.
|
|
999
|
+
* swatch.baseShade; // e.g. 500
|
|
976
1000
|
* const light = swatch[100]; // lightest shade
|
|
977
1001
|
* const dark = swatch[900]; // darkest shade
|
|
978
1002
|
*
|
|
979
1003
|
* const extendedSwatch = new Color('#ff0000').getColorSwatch({ extended: true, centerOn500: true });
|
|
980
|
-
* extendedSwatch.
|
|
1004
|
+
* extendedSwatch.baseShade; // 500
|
|
981
1005
|
* const midLight = extendedSwatch[150]; // halfway between 100 and 200
|
|
982
1006
|
* const darkest = extendedSwatch[950]; // darker than 900
|
|
983
1007
|
* ```
|
|
@@ -1230,4 +1254,4 @@ declare class Color implements ColorBrand {
|
|
|
1230
1254
|
clone(): Color;
|
|
1231
1255
|
}
|
|
1232
1256
|
|
|
1233
|
-
export { type APCAReadabilityOptions, type APCAReadabilityPolicy, type APCAReadabilityReport, type APCAThresholdPreset, type AverageColorsOptions, type BaseColorName, type BlendColorsOptions, type BlendMode, type BlendSpace, type CIE94Options, type CIEDE2000Options, Color, type ColorBrightnessOptions, type ColorBrightnessSpace, type ColorCMYK, type ColorDarknessMode, type ColorFormat, type ColorGradientEasing, type ColorGradientInterpolation, type ColorGradientOptions, type ColorGradientSpace, type ColorHSL, type ColorHSLA, type ColorHSV, type ColorHSVA, type ColorHWB, type ColorHWBA, type ColorHarmony, type ColorHarmonyOptions, type ColorHex, type ColorLAB, type ColorLCH, type ColorLightnessModifier, type ColorNameAndLightness, type ColorOKLAB, type ColorOKLCH, type ColorPalette, type ColorRGB, type ColorRGBA, type ColorSaturationOptions, type ColorSaturationSpace, type ColorSpace, type ColorStringOptions, type ColorSwatch, type ColorSwatchOptions, type ColorTemperatureAndLabel, type ColorTemperatureLabel, type ColorTemperatureStringFormatOptions, type DeltaEMethod, type DeltaEOptions, type ExtendedColorSwatch, type GenerateColorPaletteOptions, type GrayscaleHandlingMode, type HueInterpolationMode, type IsColorDarkOptions, type MixColorsOptions, type MixSpace, type MixType, type RandomColorOptions, type ReadabilityAlgorithm, type ReadabilityOptions, type WCAGReadabilityConformanceLevel, type WCAGReadabilityOptions, type WCAGReadabilityReport, type WCAGReadabilityTextSizeOptions };
|
|
1257
|
+
export { type APCAReadabilityOptions, type APCAReadabilityPolicy, type APCAReadabilityReport, type APCAThresholdPreset, type AverageColorsOptions, type BaseColorName, type BaseColorSwatch, type BaseColorSwatchShade, type BlendColorsOptions, type BlendMode, type BlendSpace, type CIE94Options, type CIEDE2000Options, Color, type ColorBrightnessOptions, type ColorBrightnessSpace, type ColorCMYK, type ColorDarknessMode, type ColorFormat, type ColorGradientEasing, type ColorGradientInterpolation, type ColorGradientOptions, type ColorGradientSpace, type ColorHSL, type ColorHSLA, type ColorHSV, type ColorHSVA, type ColorHWB, type ColorHWBA, type ColorHarmony, type ColorHarmonyOptions, type ColorHex, type ColorLAB, type ColorLCH, type ColorLightnessModifier, type ColorNameAndLightness, type ColorOKLAB, type ColorOKLCH, type ColorPalette, type ColorRGB, type ColorRGBA, type ColorSaturationOptions, type ColorSaturationSpace, type ColorSpace, type ColorStringOptions, type ColorSwatch, type ColorSwatchOptions, type ColorTemperatureAndLabel, type ColorTemperatureLabel, type ColorTemperatureStringFormatOptions, type DeltaEMethod, type DeltaEOptions, type ExtendedColorSwatch, type ExtendedColorSwatchShade, type GenerateColorPaletteOptions, type GrayscaleHandlingMode, type HueInterpolationMode, type IsColorDarkOptions, type MixColorsOptions, type MixSpace, type MixType, type RandomColorOptions, type ReadabilityAlgorithm, type ReadabilityOptions, type TetradicHarmonyDirection, type TetradicHarmonyOptions, type WCAGReadabilityConformanceLevel, type WCAGReadabilityOptions, type WCAGReadabilityReport, type WCAGReadabilityTextSizeOptions };
|