完成世界书、骰子、apiconfig页面处理

This commit is contained in:
2026-04-30 01:35:10 +08:00
parent a3e3711b2b
commit ba9b925c32
4602 changed files with 785225 additions and 23 deletions

View File

@@ -0,0 +1,3 @@
import Channels from './';
declare const channels: Channels;
export default channels;

9
frontend/node_modules/khroma/dist/color/hsl.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { Channels } from '../types';
declare const HSL: {
re: RegExp;
hueRe: RegExp;
_hue2deg: (hue: string) => number;
parse: (color: string) => Channels | void;
stringify: (channels: Channels) => string;
};
export default HSL;

7
frontend/node_modules/khroma/dist/color/rgb.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import type { Channels } from '../types';
declare const RGB: {
re: RegExp;
parse: (color: string) => Channels | void;
stringify: (channels: Channels) => string;
};
export default RGB;

7
frontend/node_modules/khroma/dist/constants.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
declare const DEC2HEX: Record<number, string>;
declare const TYPE: {
readonly ALL: 0;
readonly RGB: 1;
readonly HSL: 2;
};
export { DEC2HEX, TYPE };

13
frontend/node_modules/khroma/dist/constants.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
/* IMPORT */
import _ from './utils/index.js';
/* MAIN */
const DEC2HEX = {};
for (let i = 0; i <= 255; i++)
DEC2HEX[i] = _.unit.dec2hex(i); // Populating dynamically, striking a balance between code size and performance
const TYPE = {
ALL: 0,
RGB: 1,
HSL: 2
};
/* EXPORT */
export { DEC2HEX, TYPE };

View File

@@ -0,0 +1,14 @@
/* IMPORT */
import _ from '../utils/index.js';
import Color from '../color/index.js';
/* MAIN */
const adjustChannel = (color, channel, amount) => {
const channels = Color.parse(color);
const amountCurrent = channels[channel];
const amountNext = _.channel.clamp[channel](amountCurrent + amount);
if (amountCurrent !== amountNext)
channels[channel] = amountNext;
return Color.stringify(channels);
};
/* EXPORT */
export default adjustChannel;

8
frontend/node_modules/khroma/dist/methods/alpha.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/* IMPORT */
import channel from './channel.js';
/* MAIN */
const alpha = (color) => {
return channel(color, 'a');
};
/* EXPORT */
export default alpha;

3
frontend/node_modules/khroma/dist/methods/blue.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { Channels } from '../types';
declare const blue: (color: string | Channels) => number;
export default blue;

View File

@@ -0,0 +1,3 @@
import type { Channels } from '../types';
declare const complement: (color: string | Channels) => string;
export default complement;

View File

@@ -0,0 +1,2 @@
declare const contrast: (color1: string, color2: string) => number;
export default contrast;

View File

@@ -0,0 +1,3 @@
import type { Channels } from '../types';
declare const darken: (color: string | Channels, amount: number) => string;
export default darken;

View File

@@ -0,0 +1,3 @@
import type { Channels } from '../types';
declare const desaturate: (color: string | Channels, amount: number) => string;
export default desaturate;

View File

@@ -0,0 +1,8 @@
/* IMPORT */
import change from './change.js';
/* MAIN */
const grayscale = (color) => {
return change(color, { s: 0 });
};
/* EXPORT */
export default grayscale;

8
frontend/node_modules/khroma/dist/methods/green.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/* IMPORT */
import channel from './channel.js';
/* MAIN */
const green = (color) => {
return channel(color, 'g');
};
/* EXPORT */
export default green;

16
frontend/node_modules/khroma/dist/methods/hsla.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/* IMPORT */
import _ from '../utils/index.js';
import ChannelsReusable from '../channels/reusable.js';
import Color from '../color/index.js';
/* MAIN */
const hsla = (h, s, l, a = 1) => {
const channels = ChannelsReusable.set({
h: _.channel.clamp.h(h),
s: _.channel.clamp.s(s),
l: _.channel.clamp.l(l),
a: _.channel.clamp.a(a)
});
return Color.stringify(channels);
};
/* EXPORT */
export default hsla;

40
frontend/node_modules/khroma/dist/methods/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import hex from './rgba';
import rgb from './rgba';
import rgba from './rgba';
import hsl from './hsla';
import hsla from './hsla';
import toKeyword from './to_keyword';
import toHex from './to_hex';
import toRgba from './to_rgba';
import toHsla from './to_hsla';
import channel from './channel';
import red from './red';
import green from './green';
import blue from './blue';
import hue from './hue';
import saturation from './saturation';
import lightness from './lightness';
import alpha from './alpha';
import opacity from './alpha';
import contrast from './contrast';
import luminance from './luminance';
import isDark from './is_dark';
import isLight from './is_light';
import isTransparent from './is_transparent';
import isValid from './is_valid';
import saturate from './saturate';
import desaturate from './desaturate';
import lighten from './lighten';
import darken from './darken';
import opacify from './opacify';
import fadeIn from './opacify';
import transparentize from './transparentize';
import fadeOut from './transparentize';
import complement from './complement';
import grayscale from './grayscale';
import adjust from './adjust';
import change from './change';
import invert from './invert';
import mix from './mix';
import scale from './scale';
export { hex, rgb, rgba, hsl, hsla, toKeyword, toHex, toRgba, toHsla, channel, red, green, blue, hue, saturation, lightness, alpha, opacity, contrast, luminance, isDark, isLight, isTransparent, isValid, saturate, desaturate, lighten, darken, opacify, fadeIn, transparentize, fadeOut, complement, grayscale, adjust, change, invert, mix, scale };

View File

@@ -0,0 +1,3 @@
import type { Channels } from '../types';
declare const isTransparent: (color: string | Channels) => boolean;
export default isTransparent;

14
frontend/node_modules/khroma/dist/methods/is_valid.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
/* IMPORT */
import Color from '../color/index.js';
/* MAIN */
const isValid = (color) => {
try {
Color.parse(color);
return true;
}
catch {
return false;
}
};
/* EXPORT */
export default isValid;

View File

@@ -0,0 +1,3 @@
import type { Channels } from '../types';
declare const lightness: (color: string | Channels) => number;
export default lightness;

View File

@@ -0,0 +1,8 @@
/* IMPORT */
import channel from './channel.js';
/* MAIN */
const lightness = (color) => {
return channel(color, 'l');
};
/* EXPORT */
export default lightness;

22
frontend/node_modules/khroma/dist/methods/mix.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/* IMPORT */
import Color from '../color/index.js';
import rgba from './rgba.js';
/* MAIN */
//SOURCE: https://github.com/sass/dart-sass/blob/7457d2e9e7e623d9844ffd037a070cf32d39c348/lib/src/functions/color.dart#L718-L756
const mix = (color1, color2, weight = 50) => {
const { r: r1, g: g1, b: b1, a: a1 } = Color.parse(color1);
const { r: r2, g: g2, b: b2, a: a2 } = Color.parse(color2);
const weightScale = weight / 100;
const weightNormalized = (weightScale * 2) - 1;
const alphaDelta = a1 - a2;
const weight1combined = ((weightNormalized * alphaDelta) === -1) ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta);
const weight1 = (weight1combined + 1) / 2;
const weight2 = 1 - weight1;
const r = (r1 * weight1) + (r2 * weight2);
const g = (g1 * weight1) + (g2 * weight2);
const b = (b1 * weight1) + (b2 * weight2);
const a = (a1 * weightScale) + (a2 * (1 - weightScale));
return rgba(r, g, b, a);
};
/* EXPORT */
export default mix;

8
frontend/node_modules/khroma/dist/methods/opacify.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/* IMPORT */
import adjustChannel from './adjust_channel.js';
/* MAIN */
const opacify = (color, amount) => {
return adjustChannel(color, 'a', amount);
};
/* EXPORT */
export default opacify;

19
frontend/node_modules/khroma/dist/methods/rgba.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
/* IMPORT */
import _ from '../utils/index.js';
import ChannelsReusable from '../channels/reusable.js';
import Color from '../color/index.js';
import change from './change.js';
/* MAIN */
const rgba = (r, g, b = 0, a = 1) => {
if (typeof r !== 'number')
return change(r, { a: g });
const channels = ChannelsReusable.set({
r: _.channel.clamp.r(r),
g: _.channel.clamp.g(g),
b: _.channel.clamp.b(b),
a: _.channel.clamp.a(a)
});
return Color.stringify(channels);
};
/* EXPORT */
export default rgba;

View File

@@ -0,0 +1,8 @@
/* IMPORT */
import adjustChannel from './adjust_channel.js';
/* MAIN */
const transparentize = (color, amount) => {
return adjustChannel(color, 'a', -amount);
};
/* EXPORT */
export default transparentize;

2
frontend/node_modules/khroma/dist/types.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
/* IMPORT */
export {};

34
frontend/node_modules/khroma/dist/utils/channel.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import type { RGB, HSL } from '../types';
declare const Channel: {
min: {
r: number;
g: number;
b: number;
s: number;
l: number;
a: number;
};
max: {
r: number;
g: number;
b: number;
h: number;
s: number;
l: number;
a: number;
};
clamp: {
r: (r: number) => number;
g: (g: number) => number;
b: (b: number) => number;
h: (h: number) => number;
s: (s: number) => number;
l: (l: number) => number;
a: (a: number) => number;
};
toLinear: (c: number) => number;
hue2rgb: (p: number, q: number, t: number) => number;
hsl2rgb: ({ h, s, l }: HSL, channel: keyof RGB) => number;
rgb2hsl: ({ r, g, b }: RGB, channel: keyof HSL) => number;
};
export default Channel;

42
frontend/node_modules/khroma/dist/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,42 @@
declare const Utils: {
channel: {
min: {
r: number;
g: number;
b: number;
s: number;
l: number;
a: number;
};
max: {
r: number;
g: number;
b: number;
h: number;
s: number;
l: number;
a: number;
};
clamp: {
r: (r: number) => number;
g: (g: number) => number;
b: (b: number) => number;
h: (h: number) => number;
s: (s: number) => number;
l: (l: number) => number;
a: (a: number) => number;
};
toLinear: (c: number) => number;
hue2rgb: (p: number, q: number, t: number) => number;
hsl2rgb: ({ h, s, l }: import("../types").HSL, channel: keyof import("../types").RGB) => number;
rgb2hsl: ({ r, g, b }: import("../types").RGB, channel: keyof import("../types").HSL) => number;
};
lang: {
clamp: (number: number, lower: number, upper: number) => number;
round: (number: number) => number;
};
unit: {
dec2hex: (dec: number) => string;
};
};
export default Utils;

4
frontend/node_modules/khroma/dist/utils/unit.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
declare const Unit: {
dec2hex: (dec: number) => string;
};
export default Unit;