Brunobkr commited on
Commit
981058a
·
verified ·
1 Parent(s): fc1fe22

Upload folder using huggingface_hub (part 42)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. tools/ui/node_modules/khroma/dist/index.js +2 -0
  3. tools/ui/node_modules/khroma/dist/methods/adjust.d.ts +3 -0
  4. tools/ui/node_modules/khroma/dist/methods/adjust.js +16 -0
  5. tools/ui/node_modules/khroma/dist/methods/adjust_channel.d.ts +3 -0
  6. tools/ui/node_modules/khroma/dist/methods/adjust_channel.js +14 -0
  7. tools/ui/node_modules/khroma/dist/methods/alpha.d.ts +3 -0
  8. tools/ui/node_modules/khroma/dist/methods/alpha.js +8 -0
  9. tools/ui/node_modules/khroma/dist/methods/blue.d.ts +3 -0
  10. tools/ui/node_modules/khroma/dist/methods/blue.js +8 -0
  11. tools/ui/node_modules/khroma/dist/methods/change.d.ts +3 -0
  12. tools/ui/node_modules/khroma/dist/methods/change.js +13 -0
  13. tools/ui/node_modules/khroma/dist/methods/channel.d.ts +3 -0
  14. tools/ui/node_modules/khroma/dist/methods/channel.js +9 -0
  15. tools/ui/node_modules/khroma/dist/methods/complement.d.ts +3 -0
  16. tools/ui/node_modules/khroma/dist/methods/complement.js +8 -0
  17. tools/ui/node_modules/khroma/dist/methods/contrast.d.ts +2 -0
  18. tools/ui/node_modules/khroma/dist/methods/contrast.js +14 -0
  19. tools/ui/node_modules/khroma/dist/methods/darken.d.ts +3 -0
  20. tools/ui/node_modules/khroma/dist/methods/darken.js +8 -0
  21. tools/ui/node_modules/khroma/dist/methods/desaturate.d.ts +3 -0
  22. tools/ui/node_modules/khroma/dist/methods/desaturate.js +8 -0
  23. tools/ui/node_modules/khroma/dist/methods/grayscale.d.ts +3 -0
  24. tools/ui/node_modules/khroma/dist/methods/grayscale.js +8 -0
  25. tools/ui/node_modules/khroma/dist/methods/green.d.ts +3 -0
  26. tools/ui/node_modules/khroma/dist/methods/green.js +8 -0
  27. tools/ui/node_modules/khroma/dist/methods/hsla.d.ts +2 -0
  28. tools/ui/node_modules/khroma/dist/methods/hsla.js +16 -0
  29. tools/ui/node_modules/khroma/dist/methods/hue.d.ts +3 -0
  30. tools/ui/node_modules/khroma/dist/methods/hue.js +8 -0
  31. tools/ui/node_modules/khroma/dist/methods/index.d.ts +40 -0
  32. tools/ui/node_modules/khroma/dist/methods/index.js +54 -0
  33. tools/ui/node_modules/khroma/dist/methods/invert.d.ts +3 -0
  34. tools/ui/node_modules/khroma/dist/methods/invert.js +13 -0
  35. tools/ui/node_modules/khroma/dist/methods/is_dark.d.ts +3 -0
  36. tools/ui/node_modules/khroma/dist/methods/is_dark.js +8 -0
  37. tools/ui/node_modules/khroma/dist/methods/is_light.d.ts +3 -0
  38. tools/ui/node_modules/khroma/dist/methods/is_light.js +8 -0
  39. tools/ui/node_modules/khroma/dist/methods/is_transparent.d.ts +3 -0
  40. tools/ui/node_modules/khroma/dist/methods/is_transparent.js +8 -0
  41. tools/ui/node_modules/khroma/dist/methods/is_valid.d.ts +2 -0
  42. tools/ui/node_modules/khroma/dist/methods/is_valid.js +14 -0
  43. tools/ui/node_modules/khroma/dist/methods/lighten.d.ts +3 -0
  44. tools/ui/node_modules/khroma/dist/methods/lighten.js +8 -0
  45. tools/ui/node_modules/khroma/dist/methods/lightness.d.ts +3 -0
  46. tools/ui/node_modules/khroma/dist/methods/lightness.js +8 -0
  47. tools/ui/node_modules/khroma/dist/methods/luminance.d.ts +3 -0
  48. tools/ui/node_modules/khroma/dist/methods/luminance.js +12 -0
  49. tools/ui/node_modules/khroma/dist/methods/mix.d.ts +3 -0
  50. tools/ui/node_modules/khroma/dist/methods/mix.js +22 -0
.gitattributes CHANGED
@@ -103,3 +103,5 @@ tools/ui/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node fil
103
  tools/ui/node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
104
  tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
105
  tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
 
 
 
103
  tools/ui/node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
104
  tools/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
105
  tools/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
106
+ tools/ui/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
107
+ tools/ui/node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
tools/ui/node_modules/khroma/dist/index.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ /* EXPORT */
2
+ export * from './methods/index.js';
tools/ui/node_modules/khroma/dist/methods/adjust.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { CHANNELS, Channels } from '../types';
2
+ declare const adjust: (color: string | Channels, channels: Partial<CHANNELS>) => string;
3
+ export default adjust;
tools/ui/node_modules/khroma/dist/methods/adjust.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import Color from '../color/index.js';
3
+ import change from './change.js';
4
+ /* MAIN */
5
+ const adjust = (color, channels) => {
6
+ const ch = Color.parse(color);
7
+ const changes = {};
8
+ for (const c in channels) {
9
+ if (!channels[c])
10
+ continue;
11
+ changes[c] = ch[c] + channels[c];
12
+ }
13
+ return change(color, changes);
14
+ };
15
+ /* EXPORT */
16
+ export default adjust;
tools/ui/node_modules/khroma/dist/methods/adjust_channel.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { CHANNEL, Channels } from '../types';
2
+ declare const adjustChannel: (color: string | Channels, channel: CHANNEL, amount: number) => string;
3
+ export default adjustChannel;
tools/ui/node_modules/khroma/dist/methods/adjust_channel.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import _ from '../utils/index.js';
3
+ import Color from '../color/index.js';
4
+ /* MAIN */
5
+ const adjustChannel = (color, channel, amount) => {
6
+ const channels = Color.parse(color);
7
+ const amountCurrent = channels[channel];
8
+ const amountNext = _.channel.clamp[channel](amountCurrent + amount);
9
+ if (amountCurrent !== amountNext)
10
+ channels[channel] = amountNext;
11
+ return Color.stringify(channels);
12
+ };
13
+ /* EXPORT */
14
+ export default adjustChannel;
tools/ui/node_modules/khroma/dist/methods/alpha.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const alpha: (color: string | Channels) => number;
3
+ export default alpha;
tools/ui/node_modules/khroma/dist/methods/alpha.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import channel from './channel.js';
3
+ /* MAIN */
4
+ const alpha = (color) => {
5
+ return channel(color, 'a');
6
+ };
7
+ /* EXPORT */
8
+ export default alpha;
tools/ui/node_modules/khroma/dist/methods/blue.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const blue: (color: string | Channels) => number;
3
+ export default blue;
tools/ui/node_modules/khroma/dist/methods/blue.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import channel from './channel.js';
3
+ /* MAIN */
4
+ const blue = (color) => {
5
+ return channel(color, 'b');
6
+ };
7
+ /* EXPORT */
8
+ export default blue;
tools/ui/node_modules/khroma/dist/methods/change.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { CHANNELS, Channels } from '../types';
2
+ declare const change: (color: string | Channels, channels: Partial<CHANNELS>) => string;
3
+ export default change;
tools/ui/node_modules/khroma/dist/methods/change.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import _ from '../utils/index.js';
3
+ import Color from '../color/index.js';
4
+ /* MAIN */
5
+ const change = (color, channels) => {
6
+ const ch = Color.parse(color);
7
+ for (const c in channels) {
8
+ ch[c] = _.channel.clamp[c](channels[c]);
9
+ }
10
+ return Color.stringify(ch);
11
+ };
12
+ /* EXPORT */
13
+ export default change;
tools/ui/node_modules/khroma/dist/methods/channel.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { CHANNEL, Channels } from '../types';
2
+ declare const channel: (color: string | Channels, channel: CHANNEL) => number;
3
+ export default channel;
tools/ui/node_modules/khroma/dist/methods/channel.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import _ from '../utils/index.js';
3
+ import Color from '../color/index.js';
4
+ /* MAIN */
5
+ const channel = (color, channel) => {
6
+ return _.lang.round(Color.parse(color)[channel]);
7
+ };
8
+ /* EXPORT */
9
+ export default channel;
tools/ui/node_modules/khroma/dist/methods/complement.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const complement: (color: string | Channels) => string;
3
+ export default complement;
tools/ui/node_modules/khroma/dist/methods/complement.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import adjustChannel from './adjust_channel.js';
3
+ /* MAIN */
4
+ const complement = (color) => {
5
+ return adjustChannel(color, 'h', 180);
6
+ };
7
+ /* EXPORT */
8
+ export default complement;
tools/ui/node_modules/khroma/dist/methods/contrast.d.ts ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ declare const contrast: (color1: string, color2: string) => number;
2
+ export default contrast;
tools/ui/node_modules/khroma/dist/methods/contrast.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import _ from '../utils/index.js';
3
+ import luminance from './luminance.js';
4
+ /* MAIN */
5
+ const contrast = (color1, color2) => {
6
+ const luminance1 = luminance(color1);
7
+ const luminance2 = luminance(color2);
8
+ const max = Math.max(luminance1, luminance2);
9
+ const min = Math.min(luminance1, luminance2);
10
+ const ratio = (max + Number.EPSILON) / (min + Number.EPSILON);
11
+ return _.lang.round(_.lang.clamp(ratio, 1, 10));
12
+ };
13
+ /* EXPORT */
14
+ export default contrast;
tools/ui/node_modules/khroma/dist/methods/darken.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const darken: (color: string | Channels, amount: number) => string;
3
+ export default darken;
tools/ui/node_modules/khroma/dist/methods/darken.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import adjustChannel from './adjust_channel.js';
3
+ /* MAIN */
4
+ const darken = (color, amount) => {
5
+ return adjustChannel(color, 'l', -amount);
6
+ };
7
+ /* EXPORT */
8
+ export default darken;
tools/ui/node_modules/khroma/dist/methods/desaturate.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const desaturate: (color: string | Channels, amount: number) => string;
3
+ export default desaturate;
tools/ui/node_modules/khroma/dist/methods/desaturate.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import adjustChannel from './adjust_channel.js';
3
+ /* MAIN */
4
+ const desaturate = (color, amount) => {
5
+ return adjustChannel(color, 's', -amount);
6
+ };
7
+ /* EXPORT */
8
+ export default desaturate;
tools/ui/node_modules/khroma/dist/methods/grayscale.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const grayscale: (color: string | Channels) => string;
3
+ export default grayscale;
tools/ui/node_modules/khroma/dist/methods/grayscale.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import change from './change.js';
3
+ /* MAIN */
4
+ const grayscale = (color) => {
5
+ return change(color, { s: 0 });
6
+ };
7
+ /* EXPORT */
8
+ export default grayscale;
tools/ui/node_modules/khroma/dist/methods/green.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const green: (color: string | Channels) => number;
3
+ export default green;
tools/ui/node_modules/khroma/dist/methods/green.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import channel from './channel.js';
3
+ /* MAIN */
4
+ const green = (color) => {
5
+ return channel(color, 'g');
6
+ };
7
+ /* EXPORT */
8
+ export default green;
tools/ui/node_modules/khroma/dist/methods/hsla.d.ts ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ declare const hsla: (h: number, s: number, l: number, a?: number) => string;
2
+ export default hsla;
tools/ui/node_modules/khroma/dist/methods/hsla.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import _ from '../utils/index.js';
3
+ import ChannelsReusable from '../channels/reusable.js';
4
+ import Color from '../color/index.js';
5
+ /* MAIN */
6
+ const hsla = (h, s, l, a = 1) => {
7
+ const channels = ChannelsReusable.set({
8
+ h: _.channel.clamp.h(h),
9
+ s: _.channel.clamp.s(s),
10
+ l: _.channel.clamp.l(l),
11
+ a: _.channel.clamp.a(a)
12
+ });
13
+ return Color.stringify(channels);
14
+ };
15
+ /* EXPORT */
16
+ export default hsla;
tools/ui/node_modules/khroma/dist/methods/hue.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const hue: (color: string | Channels) => number;
3
+ export default hue;
tools/ui/node_modules/khroma/dist/methods/hue.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import channel from './channel.js';
3
+ /* MAIN */
4
+ const hue = (color) => {
5
+ return channel(color, 'h');
6
+ };
7
+ /* EXPORT */
8
+ export default hue;
tools/ui/node_modules/khroma/dist/methods/index.d.ts ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hex from './rgba';
2
+ import rgb from './rgba';
3
+ import rgba from './rgba';
4
+ import hsl from './hsla';
5
+ import hsla from './hsla';
6
+ import toKeyword from './to_keyword';
7
+ import toHex from './to_hex';
8
+ import toRgba from './to_rgba';
9
+ import toHsla from './to_hsla';
10
+ import channel from './channel';
11
+ import red from './red';
12
+ import green from './green';
13
+ import blue from './blue';
14
+ import hue from './hue';
15
+ import saturation from './saturation';
16
+ import lightness from './lightness';
17
+ import alpha from './alpha';
18
+ import opacity from './alpha';
19
+ import contrast from './contrast';
20
+ import luminance from './luminance';
21
+ import isDark from './is_dark';
22
+ import isLight from './is_light';
23
+ import isTransparent from './is_transparent';
24
+ import isValid from './is_valid';
25
+ import saturate from './saturate';
26
+ import desaturate from './desaturate';
27
+ import lighten from './lighten';
28
+ import darken from './darken';
29
+ import opacify from './opacify';
30
+ import fadeIn from './opacify';
31
+ import transparentize from './transparentize';
32
+ import fadeOut from './transparentize';
33
+ import complement from './complement';
34
+ import grayscale from './grayscale';
35
+ import adjust from './adjust';
36
+ import change from './change';
37
+ import invert from './invert';
38
+ import mix from './mix';
39
+ import scale from './scale';
40
+ 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 };
tools/ui/node_modules/khroma/dist/methods/index.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import hex from './rgba.js'; // Alias
3
+ import rgb from './rgba.js'; // Alias
4
+ import rgba from './rgba.js';
5
+ import hsl from './hsla.js'; // Alias
6
+ import hsla from './hsla.js';
7
+ import toKeyword from './to_keyword.js';
8
+ import toHex from './to_hex.js';
9
+ import toRgba from './to_rgba.js';
10
+ import toHsla from './to_hsla.js';
11
+ import channel from './channel.js';
12
+ import red from './red.js';
13
+ import green from './green.js';
14
+ import blue from './blue.js';
15
+ import hue from './hue.js';
16
+ import saturation from './saturation.js';
17
+ import lightness from './lightness.js';
18
+ import alpha from './alpha.js';
19
+ import opacity from './alpha.js'; // Alias
20
+ import contrast from './contrast.js';
21
+ import luminance from './luminance.js';
22
+ import isDark from './is_dark.js';
23
+ import isLight from './is_light.js';
24
+ import isTransparent from './is_transparent.js';
25
+ import isValid from './is_valid.js';
26
+ import saturate from './saturate.js';
27
+ import desaturate from './desaturate.js';
28
+ import lighten from './lighten.js';
29
+ import darken from './darken.js';
30
+ import opacify from './opacify.js';
31
+ import fadeIn from './opacify.js'; // Alias
32
+ import transparentize from './transparentize.js';
33
+ import fadeOut from './transparentize.js'; // Alias
34
+ import complement from './complement.js';
35
+ import grayscale from './grayscale.js';
36
+ import adjust from './adjust.js';
37
+ import change from './change.js';
38
+ import invert from './invert.js';
39
+ import mix from './mix.js';
40
+ import scale from './scale.js';
41
+ /* EXPORT */
42
+ export {
43
+ /* CREATE */
44
+ hex, rgb, rgba, hsl, hsla,
45
+ /* CONVERT */
46
+ toKeyword, toHex, toRgba, toHsla,
47
+ /* GET - CHANNEL */
48
+ channel, red, green, blue, hue, saturation, lightness, alpha, opacity,
49
+ /* GET - MORE */
50
+ contrast, luminance, isDark, isLight, isTransparent, isValid,
51
+ /* EDIT - CHANNEL */
52
+ saturate, desaturate, lighten, darken, opacify, fadeIn, transparentize, fadeOut, complement, grayscale,
53
+ /* EDIT - MORE */
54
+ adjust, change, invert, mix, scale };
tools/ui/node_modules/khroma/dist/methods/invert.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const invert: (color: string | Channels, weight?: number) => string;
3
+ export default invert;
tools/ui/node_modules/khroma/dist/methods/invert.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import Color from '../color/index.js';
3
+ import mix from './mix.js';
4
+ /* MAIN */
5
+ const invert = (color, weight = 100) => {
6
+ const inverse = Color.parse(color);
7
+ inverse.r = 255 - inverse.r;
8
+ inverse.g = 255 - inverse.g;
9
+ inverse.b = 255 - inverse.b;
10
+ return mix(inverse, color, weight);
11
+ };
12
+ /* EXPORT */
13
+ export default invert;
tools/ui/node_modules/khroma/dist/methods/is_dark.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const isDark: (color: string | Channels) => boolean;
3
+ export default isDark;
tools/ui/node_modules/khroma/dist/methods/is_dark.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import isLight from './is_light.js';
3
+ /* MAIN */
4
+ const isDark = (color) => {
5
+ return !isLight(color);
6
+ };
7
+ /* EXPORT */
8
+ export default isDark;
tools/ui/node_modules/khroma/dist/methods/is_light.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const isLight: (color: string | Channels) => boolean;
3
+ export default isLight;
tools/ui/node_modules/khroma/dist/methods/is_light.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import luminance from './luminance.js';
3
+ /* MAIN */
4
+ const isLight = (color) => {
5
+ return luminance(color) >= .5;
6
+ };
7
+ /* EXPORT */
8
+ export default isLight;
tools/ui/node_modules/khroma/dist/methods/is_transparent.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const isTransparent: (color: string | Channels) => boolean;
3
+ export default isTransparent;
tools/ui/node_modules/khroma/dist/methods/is_transparent.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import alpha from './alpha.js';
3
+ /* MAIN */
4
+ const isTransparent = (color) => {
5
+ return !alpha(color);
6
+ };
7
+ /* EXPORT */
8
+ export default isTransparent;
tools/ui/node_modules/khroma/dist/methods/is_valid.d.ts ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ declare const isValid: (color: string) => boolean;
2
+ export default isValid;
tools/ui/node_modules/khroma/dist/methods/is_valid.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import Color from '../color/index.js';
3
+ /* MAIN */
4
+ const isValid = (color) => {
5
+ try {
6
+ Color.parse(color);
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ };
13
+ /* EXPORT */
14
+ export default isValid;
tools/ui/node_modules/khroma/dist/methods/lighten.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const lighten: (color: string | Channels, amount: number) => string;
3
+ export default lighten;
tools/ui/node_modules/khroma/dist/methods/lighten.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import adjustChannel from './adjust_channel.js';
3
+ /* MAIN */
4
+ const lighten = (color, amount) => {
5
+ return adjustChannel(color, 'l', amount);
6
+ };
7
+ /* EXPORT */
8
+ export default lighten;
tools/ui/node_modules/khroma/dist/methods/lightness.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const lightness: (color: string | Channels) => number;
3
+ export default lightness;
tools/ui/node_modules/khroma/dist/methods/lightness.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import channel from './channel.js';
3
+ /* MAIN */
4
+ const lightness = (color) => {
5
+ return channel(color, 'l');
6
+ };
7
+ /* EXPORT */
8
+ export default lightness;
tools/ui/node_modules/khroma/dist/methods/luminance.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const luminance: (color: string | Channels) => number;
3
+ export default luminance;
tools/ui/node_modules/khroma/dist/methods/luminance.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import _ from '../utils/index.js';
3
+ import Color from '../color/index.js';
4
+ /* MAIN */
5
+ //SOURCE: https://planetcalc.com/7779
6
+ const luminance = (color) => {
7
+ const { r, g, b } = Color.parse(color);
8
+ const luminance = .2126 * _.channel.toLinear(r) + .7152 * _.channel.toLinear(g) + .0722 * _.channel.toLinear(b);
9
+ return _.lang.round(luminance);
10
+ };
11
+ /* EXPORT */
12
+ export default luminance;
tools/ui/node_modules/khroma/dist/methods/mix.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ import type { Channels } from '../types';
2
+ declare const mix: (color1: string | Channels, color2: string | Channels, weight?: number) => string;
3
+ export default mix;
tools/ui/node_modules/khroma/dist/methods/mix.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IMPORT */
2
+ import Color from '../color/index.js';
3
+ import rgba from './rgba.js';
4
+ /* MAIN */
5
+ //SOURCE: https://github.com/sass/dart-sass/blob/7457d2e9e7e623d9844ffd037a070cf32d39c348/lib/src/functions/color.dart#L718-L756
6
+ const mix = (color1, color2, weight = 50) => {
7
+ const { r: r1, g: g1, b: b1, a: a1 } = Color.parse(color1);
8
+ const { r: r2, g: g2, b: b2, a: a2 } = Color.parse(color2);
9
+ const weightScale = weight / 100;
10
+ const weightNormalized = (weightScale * 2) - 1;
11
+ const alphaDelta = a1 - a2;
12
+ const weight1combined = ((weightNormalized * alphaDelta) === -1) ? weightNormalized : (weightNormalized + alphaDelta) / (1 + weightNormalized * alphaDelta);
13
+ const weight1 = (weight1combined + 1) / 2;
14
+ const weight2 = 1 - weight1;
15
+ const r = (r1 * weight1) + (r2 * weight2);
16
+ const g = (g1 * weight1) + (g2 * weight2);
17
+ const b = (b1 * weight1) + (b2 * weight2);
18
+ const a = (a1 * weightScale) + (a2 * (1 - weightScale));
19
+ return rgba(r, g, b, a);
20
+ };
21
+ /* EXPORT */
22
+ export default mix;