laymur 0.9.0 → 0.10.0
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/dist/index.js +317 -51
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/miscellaneous/UIColor.d.ts +107 -11
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Eventail } from "eventail";
|
|
2
2
|
import type { Color } from "three";
|
|
3
|
+
import { Vector4 } from "three";
|
|
3
4
|
/**
|
|
4
5
|
* Predefined color names supported by UIColor.
|
|
5
6
|
*/
|
|
@@ -20,6 +21,11 @@ export declare class UIColor extends Eventail {
|
|
|
20
21
|
private gInternal;
|
|
21
22
|
private bInternal;
|
|
22
23
|
private aInternal;
|
|
24
|
+
private hInternal;
|
|
25
|
+
private sInternal;
|
|
26
|
+
private lInternal;
|
|
27
|
+
private rgbDirty;
|
|
28
|
+
private hslDirty;
|
|
23
29
|
constructor();
|
|
24
30
|
/**
|
|
25
31
|
* @param colorName - Named color
|
|
@@ -38,6 +44,82 @@ export declare class UIColor extends Eventail {
|
|
|
38
44
|
* @param a - Alpha (0-1)
|
|
39
45
|
*/
|
|
40
46
|
constructor(hexRGB: number, a?: number);
|
|
47
|
+
/** Creates black color (0x000000). */
|
|
48
|
+
static get black(): UIColor;
|
|
49
|
+
/** Creates white color (0xFFFFFF). */
|
|
50
|
+
static get white(): UIColor;
|
|
51
|
+
/** Creates red color (0xFF0000). */
|
|
52
|
+
static get red(): UIColor;
|
|
53
|
+
/** Creates green color (0x008000). */
|
|
54
|
+
static get green(): UIColor;
|
|
55
|
+
/** Creates blue color (0x0000FF). */
|
|
56
|
+
static get blue(): UIColor;
|
|
57
|
+
/** Creates yellow color (0xFFFF00). */
|
|
58
|
+
static get yellow(): UIColor;
|
|
59
|
+
/** Creates cyan color (0x00FFFF). */
|
|
60
|
+
static get cyan(): UIColor;
|
|
61
|
+
/** Creates magenta color (0xFF00FF). */
|
|
62
|
+
static get magenta(): UIColor;
|
|
63
|
+
/** Creates gray color (0x808080). */
|
|
64
|
+
static get gray(): UIColor;
|
|
65
|
+
/** Creates grey color (0x808080). */
|
|
66
|
+
static get grey(): UIColor;
|
|
67
|
+
/** Creates silver color (0xC0C0C0). */
|
|
68
|
+
static get silver(): UIColor;
|
|
69
|
+
/** Creates maroon color (0x800000). */
|
|
70
|
+
static get maroon(): UIColor;
|
|
71
|
+
/** Creates olive color (0x808000). */
|
|
72
|
+
static get olive(): UIColor;
|
|
73
|
+
/** Creates lime color (0x00FF00). */
|
|
74
|
+
static get lime(): UIColor;
|
|
75
|
+
/** Creates aqua color (0x00FFFF). */
|
|
76
|
+
static get aqua(): UIColor;
|
|
77
|
+
/** Creates teal color (0x008080). */
|
|
78
|
+
static get teal(): UIColor;
|
|
79
|
+
/** Creates navy color (0x000080). */
|
|
80
|
+
static get navy(): UIColor;
|
|
81
|
+
/** Creates fuchsia color (0xFF00FF). */
|
|
82
|
+
static get fuchsia(): UIColor;
|
|
83
|
+
/** Creates purple color (0x800080). */
|
|
84
|
+
static get purple(): UIColor;
|
|
85
|
+
/** Creates orange color (0xFFA500). */
|
|
86
|
+
static get orange(): UIColor;
|
|
87
|
+
/** Creates pink color (0xFFC0CB). */
|
|
88
|
+
static get pink(): UIColor;
|
|
89
|
+
/** Creates brown color (0xA52A2A). */
|
|
90
|
+
static get brown(): UIColor;
|
|
91
|
+
/** Creates gold color (0xFFD700). */
|
|
92
|
+
static get gold(): UIColor;
|
|
93
|
+
/** Creates violet color (0xEE82EE). */
|
|
94
|
+
static get violet(): UIColor;
|
|
95
|
+
/** Creates indigo color (0x4B0082). */
|
|
96
|
+
static get indigo(): UIColor;
|
|
97
|
+
/** Creates coral color (0xFF7F50). */
|
|
98
|
+
static get coral(): UIColor;
|
|
99
|
+
/** Creates salmon color (0xFA8072). */
|
|
100
|
+
static get salmon(): UIColor;
|
|
101
|
+
/** Creates khaki color (0xF0E68C). */
|
|
102
|
+
static get khaki(): UIColor;
|
|
103
|
+
/** Creates plum color (0xDDA0DD). */
|
|
104
|
+
static get plum(): UIColor;
|
|
105
|
+
/** Creates orchid color (0xDA70D6). */
|
|
106
|
+
static get orchid(): UIColor;
|
|
107
|
+
/** Creates tan color (0xD2B48C). */
|
|
108
|
+
static get tan(): UIColor;
|
|
109
|
+
/** Creates beige color (0xF5F5DC). */
|
|
110
|
+
static get beige(): UIColor;
|
|
111
|
+
/** Creates mint color (0x98FB98). */
|
|
112
|
+
static get mint(): UIColor;
|
|
113
|
+
/** Creates lavender color (0xE6E6FA). */
|
|
114
|
+
static get lavender(): UIColor;
|
|
115
|
+
/** Creates crimson color (0xDC143C). */
|
|
116
|
+
static get crimson(): UIColor;
|
|
117
|
+
/** Creates azure color (0xF0FFFF). */
|
|
118
|
+
static get azure(): UIColor;
|
|
119
|
+
/** Creates ivory color (0xFFFFF0). */
|
|
120
|
+
static get ivory(): UIColor;
|
|
121
|
+
/** Creates snow color (0xFFFAFA). */
|
|
122
|
+
static get snow(): UIColor;
|
|
41
123
|
/** Red component (0-1). */
|
|
42
124
|
get r(): number;
|
|
43
125
|
/** Green component (0-1). */
|
|
@@ -46,10 +128,19 @@ export declare class UIColor extends Eventail {
|
|
|
46
128
|
get b(): number;
|
|
47
129
|
/** Alpha component (0-1). */
|
|
48
130
|
get a(): number;
|
|
131
|
+
/** Hue component (0-360). */
|
|
132
|
+
get hue(): number;
|
|
133
|
+
/** Saturation component (0-1). */
|
|
134
|
+
get saturation(): number;
|
|
135
|
+
/** Lightness component (0-1). */
|
|
136
|
+
get lightness(): number;
|
|
49
137
|
set r(value: number);
|
|
50
138
|
set g(value: number);
|
|
51
139
|
set b(value: number);
|
|
52
140
|
set a(value: number);
|
|
141
|
+
set hue(value: number);
|
|
142
|
+
set saturation(value: number);
|
|
143
|
+
set lightness(value: number);
|
|
53
144
|
/**
|
|
54
145
|
* Sets all color components.
|
|
55
146
|
*
|
|
@@ -68,16 +159,6 @@ export declare class UIColor extends Eventail {
|
|
|
68
159
|
* Returns 24-bit hex RGB value.
|
|
69
160
|
*/
|
|
70
161
|
getHexRGB(): number;
|
|
71
|
-
/**
|
|
72
|
-
* Converts to HSL format.
|
|
73
|
-
*
|
|
74
|
-
* @returns Object with h (0-360), s (0-1), l (0-1)
|
|
75
|
-
*/
|
|
76
|
-
getHSL(): {
|
|
77
|
-
h: number;
|
|
78
|
-
s: number;
|
|
79
|
-
l: number;
|
|
80
|
-
};
|
|
81
162
|
/**
|
|
82
163
|
* Sets color from 32-bit hex RGBA value.
|
|
83
164
|
*
|
|
@@ -111,11 +192,18 @@ export declare class UIColor extends Eventail {
|
|
|
111
192
|
* @returns This instance
|
|
112
193
|
* @throws Error if color name is unknown
|
|
113
194
|
*/
|
|
114
|
-
|
|
195
|
+
setColorName(colorName: UIColorName, a?: number): this;
|
|
115
196
|
/**
|
|
116
197
|
* Returns CSS rgba() string.
|
|
117
198
|
*/
|
|
118
199
|
toCSSColor(): string;
|
|
200
|
+
/**
|
|
201
|
+
* Converts color to linear color space for GLSL.
|
|
202
|
+
*
|
|
203
|
+
* @param result - Vector4 to store the result
|
|
204
|
+
* @returns Vector4 with linear RGB (0-1) and alpha
|
|
205
|
+
*/
|
|
206
|
+
toGLSLColor(result?: Vector4): Vector4;
|
|
119
207
|
/**
|
|
120
208
|
* Copies values from another color.
|
|
121
209
|
*
|
|
@@ -127,4 +215,12 @@ export declare class UIColor extends Eventail {
|
|
|
127
215
|
* Creates a copy of this color.
|
|
128
216
|
*/
|
|
129
217
|
clone(): UIColor;
|
|
218
|
+
/**
|
|
219
|
+
* Updates RGB values from HSL if needed.
|
|
220
|
+
*/
|
|
221
|
+
private ensureRGBUpdatedFromHSL;
|
|
222
|
+
/**
|
|
223
|
+
* Updates HSL values from RGB if needed.
|
|
224
|
+
*/
|
|
225
|
+
private ensureHSLUpdatedFromRGB;
|
|
130
226
|
}
|