-
Notifications
You must be signed in to change notification settings - Fork 0
/
color.d.ts
45 lines (39 loc) · 851 Bytes
/
color.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
38
39
40
41
42
43
44
45
export type RGB = {
r: number
g: number
b: number
}
export type HSL = {
h: number
s: number
l: number
}
export type HSV = {
h: number
s: number
v: number
}
export type CMYK = {
c: number
m: number
y: number
k: number
}
export type hex2RGB = (hex: string) => RGB
export type invertColor = (hex: string, bw?: boolean) => string
export type rgb2Hex = (r: number, g: number, b: number) => string
export type rgb2HSL = (r: number, g: number, b: number) => HSL
export type hex2HSL = (hex: string) => HSL
export type rgb2HSV = (r: number, g: number, b: number) => HSV
export type hex2HSV = (hex: string) => HSV
export interface Color {
hex2RGB: hex2RGB
invertColor: invertColor
rgb2Hex: rgb2Hex
rgb2HSL: rgb2HSL
hex2HSL: hex2HSL
rgb2HSV: rgb2HSV
hex2HSV: hex2HSV
}
declare const color: Color
export default color