-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVibrant.d.ts
37 lines (31 loc) · 1011 Bytes
/
Vibrant.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
type Tuple<T, N extends number, TArr extends T[] = []> =
number extends N ? T[] : TArr['length'] extends N ? TArr : Tuple<T, N, [T, ...TArr]>;
type Maybe<T> = T | undefined;
interface VibrantConstructor {
/**
* @param image
* @param [paletteNumberCount=64]
* @param [quality=5]
*/
new (image: HTMLImageElement!, paletteNumberCount?: number = 64, quality?: number = 5): VibrantObj;
}
interface VibrantObj {
swatches(): VibrantSwatches;
}
interface VibrantSwatches {
Vibrant: Maybe<VibrantSwatch>;
Muted: Maybe<VibrantSwatch>;
DarkVibrant: Maybe<VibrantSwatch>;
DarkMuted: Maybe<VibrantSwatch>;
LightVibrant: Maybe<VibrantSwatch>;
LightMuted: Maybe<VibrantSwatch>;
};
interface VibrantSwatch {
//new (rgb: Tuple<number, 3>, population: number): VibrantSwatch;
getRgb(): Tuple<number, 3>;
getHsl(): Tuple<number, 3>;
getHex(): string;
getPopulation(): number;
getTitleTextColor(): string;
getBodyTextColor(): string;
}