/
hsi.ts
34 lines (32 loc) · 936 Bytes
/
hsi.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
import type { IRandom } from "@thi.ng/random";
import type { Vec } from "@thi.ng/vectors";
import type { Color, ColorFactory, ReadonlyColor, TypedColor } from "../api";
import { defColor } from "../defcolor";
import { rgbHsi } from "../rgb/rgb-hsi";
export declare class HSI implements TypedColor<HSI> {
buf: Vec;
offset: number;
stride: number;
h: number;
s: number;
i: number;
alpha: number;
[id: number]: number;
readonly mode: "hsi";
readonly length: 4;
[Symbol.iterator](): Iterator<number, any, undefined>;
clamp(): this;
copy(): HSI;
copyView(): HSI;
deref(): Color;
empty(): HSI;
eqDelta(o: HSI, eps?: number): boolean;
randomize(rnd?: IRandom): this;
set(src: ReadonlyColor): this;
toJSON(): number[];
}
export const hsi = <ColorFactory<HSI>>defColor({
mode: "hsi",
order: <const>["h", "s", "i", "alpha"],
from: { rgb: rgbHsi },
});