forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
please.d.ts
121 lines (105 loc) · 2.94 KB
/
please.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Type definitions for PleaseJS
// Project: http://www.checkman.io/please/
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var Please: PleaseJS.Please;
declare module PleaseJS{
export interface Please{
/***
* generate and return a random hex string
* @param {MakeColorOption} options
* @returns {Array}
*/
make_color(options?: MakeColorOption): Array<string>;
make_color(options?: MakeColorOption): Array<RGB>;
make_color(options?: MakeColorOption): Array<HSV>;
/***
* make a color scheme
* @param {MakeSchemeOption} options
* @returns {Array}
*/
make_scheme(base_color: HSV, options?: MakeSchemeOption): Array<string>;
make_scheme(base_color: HSV, options?: MakeSchemeOption): Array<RGB>;
make_scheme(base_color: HSV, options?: MakeSchemeOption): Array<HSV>;
/***
* convert color name into hex string
* @param {string} name
* @returns {string}
*/
NAME_to_HEX(name: string): string;
/***
* convert color name into RGB
* @param {string} name
* @returns {RGB}
*/
NAME_to_RGB(name: string): RGB;
/***
* convert color name into RGB
* @param {string} name
* @returns {HSV}
*/
NAME_to_HSV(name: string): HSV;
/***
* convert HEX into RGB
* @param {string} hex
* @returns {RGB}
*/
HEX_to_RGB(hex: string): RGB;
/***
* convert RGB into HEX
* @param {RGB} rgb
* @returns {string}
*/
RGB_to_HEX(rgb: RGB): string;
/***
* convert HSV into RGB
* @param {HSV} hsv
* @returns {RGB}
*/
HSV_to_RGB(hsv: HSV): RGB;
/***
* convert RGB into HSV
* @param {RGB} rgb
* @returns {HSV}
*/
RGB_to_HSV(rgb: RGB): HSV;
/***
* convert HSV into HEX
* @param {HSV} hsv
* @returns {string}
*/
HSV_to_HEX(hsv: HSV): string;
/***
* convert HEX into HSV
* @param {string} hex
* @returns {HSV}
*/
HEX_to_HSV(hex: string): HSV;
}
export interface MakeColorOption{
hue?: number;
saturation?: number;
value?: number;
base_color?: string;
greyscale?: boolean;
grayscale?: boolean;
golden?: boolean;
full_random?: boolean;
colors_returned?: number;
format?: string;
}
export interface MakeSchemeOption{
scheme_type: string;
format: string;
}
export interface RGB{
r: number;
g: number;
b: number;
}
export interface HSV{
h: number;
s: number;
v: number;
}
}