Initial commit of akmon project
This commit is contained in:
3
uni_modules/lime-color/utssdk/app-android-o/config.json
Normal file
3
uni_modules/lime-color/utssdk/app-android-o/config.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"minSdkVersion": "21"
|
||||
}
|
||||
2
uni_modules/lime-color/utssdk/app-android-o/index.uts
Normal file
2
uni_modules/lime-color/utssdk/app-android-o/index.uts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from '../../common/color'
|
||||
export * from '../../common/generate'
|
||||
3
uni_modules/lime-color/utssdk/app-js-o/config.json
Normal file
3
uni_modules/lime-color/utssdk/app-js-o/config.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"deploymentTarget": "9"
|
||||
}
|
||||
2
uni_modules/lime-color/utssdk/app-js-o/index.uts
Normal file
2
uni_modules/lime-color/utssdk/app-js-o/index.uts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from '../../common/color'
|
||||
export * from '../../common/generate'
|
||||
3
uni_modules/lime-color/utssdk/index-o.uts
Normal file
3
uni_modules/lime-color/utssdk/index-o.uts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from '../common/color'
|
||||
export * from '../common/generate'
|
||||
export * from './interface'
|
||||
87
uni_modules/lime-color/utssdk/interface.uts
Normal file
87
uni_modules/lime-color/utssdk/interface.uts
Normal file
@@ -0,0 +1,87 @@
|
||||
export type RGB = {
|
||||
r : number;
|
||||
g : number;
|
||||
b : number;
|
||||
}
|
||||
export type RGBA = {
|
||||
r : number;
|
||||
g : number;
|
||||
b : number;
|
||||
a : number;
|
||||
}
|
||||
export type RGBAString = {
|
||||
r : string;
|
||||
g : string;
|
||||
b : string;
|
||||
a : number;
|
||||
}
|
||||
export type HSL = {
|
||||
h : number;
|
||||
s : number;
|
||||
l : number;
|
||||
}
|
||||
|
||||
export type HSLA = {
|
||||
h : number;
|
||||
s : number;
|
||||
l : number;
|
||||
a : number;
|
||||
}
|
||||
export type HSV = {
|
||||
h : number;
|
||||
s : number;
|
||||
v : number;
|
||||
}
|
||||
|
||||
export type HSVA = {
|
||||
h : number;
|
||||
s : number;
|
||||
v : number;
|
||||
a : number;
|
||||
}
|
||||
|
||||
// 增加部分
|
||||
export type HSB = {
|
||||
h : number;
|
||||
s : number;
|
||||
b : number;
|
||||
}
|
||||
export type HSBA = {
|
||||
h : number;
|
||||
s : number;
|
||||
b : number;
|
||||
a : number;
|
||||
}
|
||||
|
||||
export type LColorInfo = {
|
||||
ok ?: boolean;
|
||||
format ?: LColorFormats;
|
||||
r : number;
|
||||
g : number;
|
||||
b : number;
|
||||
a : number;
|
||||
}
|
||||
|
||||
export type LColorFormats =
|
||||
| 'rgb'
|
||||
| 'prgb'
|
||||
| 'hex'
|
||||
| 'hex3'
|
||||
| 'hex4'
|
||||
| 'hex6'
|
||||
| 'hex8'
|
||||
| 'name'
|
||||
| 'hsl'
|
||||
| 'hsb'
|
||||
| 'hsv';
|
||||
|
||||
export type LColorOptions = {
|
||||
format ?: LColorFormats;
|
||||
gradientType ?: string;
|
||||
}
|
||||
export type LColorInput = any //string | number | RGB | RGBA | HSL | HSLA | HSV | HSVA | LimeColor;
|
||||
|
||||
export type LGenerateOptions = {
|
||||
theme ?: 'dark' | 'default';
|
||||
backgroundColor ?: string;
|
||||
}
|
||||
41
uni_modules/lime-color/utssdk/unierror.uts
Normal file
41
uni_modules/lime-color/utssdk/unierror.uts
Normal file
@@ -0,0 +1,41 @@
|
||||
/* 此规范为 uni 规范,可以按照自己的需要选择是否实现 */
|
||||
import { MyApiErrorCode, MyApiFail } from "./interface.uts"
|
||||
/**
|
||||
* 错误主题
|
||||
* 注意:错误主题一般为插件名称,每个组件不同,需要使用时请更改。
|
||||
* [可选实现]
|
||||
*/
|
||||
export const UniErrorSubject = 'uts-api';
|
||||
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
* @UniError
|
||||
* [可选实现]
|
||||
*/
|
||||
export const UniErrors : Map<MyApiErrorCode, string> = new Map([
|
||||
/**
|
||||
* 错误码及对应的错误信息
|
||||
*/
|
||||
[9010001, 'custom error mseeage1'],
|
||||
[9010002, 'custom error mseeage2'],
|
||||
]);
|
||||
|
||||
|
||||
/**
|
||||
* 错误对象实现
|
||||
*/
|
||||
export class MyApiFailImpl extends UniError implements MyApiFail {
|
||||
|
||||
/**
|
||||
* 错误对象构造函数
|
||||
*/
|
||||
constructor(errCode : MyApiErrorCode) {
|
||||
super();
|
||||
this.errSubject = UniErrorSubject;
|
||||
this.errCode = errCode;
|
||||
this.errMsg = UniErrors[errCode] ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user