Initial commit of akmon project

This commit is contained in:
2026-01-20 08:04:15 +08:00
commit 77a2bab985
1309 changed files with 343305 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
{
"minSdkVersion": "21"
}

View File

@@ -0,0 +1,2 @@
export * from '../../common/color'
export * from '../../common/generate'

View File

@@ -0,0 +1,3 @@
{
"deploymentTarget": "9"
}

View File

@@ -0,0 +1,2 @@
export * from '../../common/color'
export * from '../../common/generate'

View File

@@ -0,0 +1,3 @@
export * from '../common/color'
export * from '../common/generate'
export * from './interface'

View 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;
}

View 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] ?? "";
}
}