gis-common 4.2.4 → 4.2.5
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/CHANGELOG.md +13 -0
- package/dist/core/Color.d.ts +66 -0
- package/dist/core/HashMap.d.ts +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/gis-common.es.js +1132 -1066
- package/dist/gis-common.umd.js +1 -1
- package/dist/utils/CommUtil.d.ts +1 -1
- package/dist/utils/CoordsUtil.d.ts +14 -6
- package/dist/utils/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/utils/ColorUtil.d.ts +0 -37
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
此工具库的所有显著更改都将记录在此文件中,请参阅[标准版本](http://xxx)以获取提交指南。
|
|
4
|
+
|
|
5
|
+
## [0.1.2](http://git.xxx/343790edee6d5d09c5615ed94a40bcdd7bbfe781) (2024-09-06)
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
* 修改OptimizeUtil的防抖程序
|
|
9
|
+
|
|
10
|
+
## [0.1.1](http://git.xxx/316a0dd828161549f48ead0f414fb5c9ffb1e5cc) (2024-09-04)
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
* 进行typescript改造,增加types以方便智能代码提示
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
interface ColorRGBA {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
a?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 基本的颜色类,支持RGB颜色
|
|
9
|
+
*/
|
|
10
|
+
export default class Color {
|
|
11
|
+
private _r;
|
|
12
|
+
private _g;
|
|
13
|
+
private _b;
|
|
14
|
+
private _alpha;
|
|
15
|
+
constructor(r: number, g: number, b: number, a?: number);
|
|
16
|
+
private _validateColorChannel;
|
|
17
|
+
get rgba(): ColorRGBA;
|
|
18
|
+
get hex(): string;
|
|
19
|
+
setRgb(r: number, g: number, b: number, a: number): Color;
|
|
20
|
+
/**
|
|
21
|
+
* 从RGBA字符串创建Color对象
|
|
22
|
+
*
|
|
23
|
+
* @param rgbaValue RGBA颜色值字符串,格式为"rgba(r,g,b,a)"或"rgb(r,g,b)"
|
|
24
|
+
* @returns 返回Color对象
|
|
25
|
+
* @throws 如果rgbaValue不是有效的RGBA颜色值,则抛出错误
|
|
26
|
+
*/
|
|
27
|
+
static fromRgba(rgbaValue: string): Color;
|
|
28
|
+
/**
|
|
29
|
+
* 将十六进制颜色值转换为颜色对象
|
|
30
|
+
*
|
|
31
|
+
* @param hexValue 十六进制颜色值,可带或不带#前缀,支持3位和6位表示
|
|
32
|
+
* @returns 返回颜色对象
|
|
33
|
+
*/
|
|
34
|
+
static fromHex(hexValue: string, a?: number): Color;
|
|
35
|
+
/**
|
|
36
|
+
* 从 HSL 字符串创建颜色对象
|
|
37
|
+
*
|
|
38
|
+
* @param hsl HSL 字符串,格式为 hsl(h, s%, l%) 或 hsla(h, s%, l%, a)
|
|
39
|
+
* @returns 返回颜色对象,如果 hsl 字符串无效则返回 null
|
|
40
|
+
*/
|
|
41
|
+
static fromHsl(hslValue: string): Color;
|
|
42
|
+
/**
|
|
43
|
+
* 从字符串中创建颜色对象
|
|
44
|
+
*
|
|
45
|
+
* @param str 字符串类型的颜色值,支持rgba、hex、hsl格式
|
|
46
|
+
* @returns 返回创建的颜色对象
|
|
47
|
+
* @throws 当颜色值无效时,抛出错误
|
|
48
|
+
*/
|
|
49
|
+
static from(str: string): Color;
|
|
50
|
+
/**
|
|
51
|
+
* 将RGB颜色值转换为十六进制颜色值
|
|
52
|
+
*
|
|
53
|
+
* @param r 红色分量值,取值范围0-255
|
|
54
|
+
* @param g 绿色分量值,取值范围0-255
|
|
55
|
+
* @param b 蓝色分量值,取值范围0-255
|
|
56
|
+
* @param a 可选参数,透明度分量值,取值范围0-1
|
|
57
|
+
* @returns 十六进制颜色值,格式为#RRGGBB或#RRGGBBAA
|
|
58
|
+
*/
|
|
59
|
+
static rgb2hex(r: number, g: number, b: number, a?: number): string;
|
|
60
|
+
static isHex(a: string): boolean;
|
|
61
|
+
static isRgb(a: string): boolean;
|
|
62
|
+
static isHsl(a: string): boolean;
|
|
63
|
+
static isColor(a: string): boolean;
|
|
64
|
+
static random(): Color;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
package/dist/core/HashMap.d.ts
CHANGED
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as AudioPlayer } from './AudioPlayer';
|
|
2
2
|
export { default as Cookie } from './Cookie';
|
|
3
|
+
export { default as Color } from './Color';
|
|
3
4
|
export { default as CanvasDrawer } from './CanvasDrawer';
|
|
4
5
|
export { default as EventDispatcher } from './EventDispatcher';
|
|
5
6
|
export { default as HashMap } from './HashMap';
|