更新颜色计算模块。
This commit is contained in:
parent
09c5a3be78
commit
d458ac3cb6
2
src/color_functions/color_module.d.ts
vendored
2
src/color_functions/color_module.d.ts
vendored
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export function represent_rgb(color: string): Uint8Array;
|
||||
export function represent_hsl(color: string): Float32Array;
|
||||
export function represent_lab(color: string): Float32Array;
|
||||
export function represent_oklch(color: string): Float32Array;
|
||||
|
@ -17,6 +18,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|||
|
||||
export interface InitOutput {
|
||||
readonly memory: WebAssembly.Memory;
|
||||
readonly represent_rgb: (a: number, b: number) => [number, number, number, number];
|
||||
readonly represent_hsl: (a: number, b: number) => [number, number, number, number];
|
||||
readonly represent_lab: (a: number, b: number) => [number, number, number, number];
|
||||
readonly represent_oklch: (a: number, b: number) => [number, number, number, number];
|
||||
|
|
|
@ -80,6 +80,26 @@ function takeFromExternrefTable0(idx) {
|
|||
return value;
|
||||
}
|
||||
|
||||
function getArrayU8FromWasm0(ptr, len) {
|
||||
ptr = ptr >>> 0;
|
||||
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
||||
}
|
||||
/**
|
||||
* @param {string} color
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
export function represent_rgb(color) {
|
||||
const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
const ret = wasm.represent_rgb(ptr0, len0);
|
||||
if (ret[3]) {
|
||||
throw takeFromExternrefTable0(ret[2]);
|
||||
}
|
||||
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
||||
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
||||
return v2;
|
||||
}
|
||||
|
||||
let cachedFloat32ArrayMemory0 = null;
|
||||
|
||||
function getFloat32ArrayMemory0() {
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,7 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export const memory: WebAssembly.Memory;
|
||||
export const represent_rgb: (a: number, b: number) => [number, number, number, number];
|
||||
export const represent_hsl: (a: number, b: number) => [number, number, number, number];
|
||||
export const represent_lab: (a: number, b: number) => [number, number, number, number];
|
||||
export const represent_oklch: (a: number, b: number) => [number, number, number, number];
|
||||
|
|
Loading…
Reference in New Issue
Block a user