chunk-XH73JGLD.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  1. import {
  2. init_define_APP_INFO
  3. } from "./chunk-XY75H3MP.js";
  4. // node_modules/@ant-design/colors/dist/index.esm.js
  5. init_define_APP_INFO();
  6. // node_modules/@ctrl/tinycolor/dist/module/public_api.js
  7. init_define_APP_INFO();
  8. // node_modules/@ctrl/tinycolor/dist/module/index.js
  9. init_define_APP_INFO();
  10. // node_modules/@ctrl/tinycolor/dist/module/conversion.js
  11. init_define_APP_INFO();
  12. // node_modules/@ctrl/tinycolor/dist/module/util.js
  13. init_define_APP_INFO();
  14. function bound01(n, max) {
  15. if (isOnePointZero(n)) {
  16. n = "100%";
  17. }
  18. var isPercent = isPercentage(n);
  19. n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
  20. if (isPercent) {
  21. n = parseInt(String(n * max), 10) / 100;
  22. }
  23. if (Math.abs(n - max) < 1e-6) {
  24. return 1;
  25. }
  26. if (max === 360) {
  27. n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
  28. } else {
  29. n = n % max / parseFloat(String(max));
  30. }
  31. return n;
  32. }
  33. function clamp01(val) {
  34. return Math.min(1, Math.max(0, val));
  35. }
  36. function isOnePointZero(n) {
  37. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  38. }
  39. function isPercentage(n) {
  40. return typeof n === "string" && n.indexOf("%") !== -1;
  41. }
  42. function boundAlpha(a) {
  43. a = parseFloat(a);
  44. if (isNaN(a) || a < 0 || a > 1) {
  45. a = 1;
  46. }
  47. return a;
  48. }
  49. function convertToPercentage(n) {
  50. if (n <= 1) {
  51. return "".concat(Number(n) * 100, "%");
  52. }
  53. return n;
  54. }
  55. function pad2(c) {
  56. return c.length === 1 ? "0" + c : String(c);
  57. }
  58. // node_modules/@ctrl/tinycolor/dist/module/conversion.js
  59. function rgbToRgb(r, g, b) {
  60. return {
  61. r: bound01(r, 255) * 255,
  62. g: bound01(g, 255) * 255,
  63. b: bound01(b, 255) * 255
  64. };
  65. }
  66. function rgbToHsl(r, g, b) {
  67. r = bound01(r, 255);
  68. g = bound01(g, 255);
  69. b = bound01(b, 255);
  70. var max = Math.max(r, g, b);
  71. var min = Math.min(r, g, b);
  72. var h = 0;
  73. var s = 0;
  74. var l = (max + min) / 2;
  75. if (max === min) {
  76. s = 0;
  77. h = 0;
  78. } else {
  79. var d = max - min;
  80. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  81. switch (max) {
  82. case r:
  83. h = (g - b) / d + (g < b ? 6 : 0);
  84. break;
  85. case g:
  86. h = (b - r) / d + 2;
  87. break;
  88. case b:
  89. h = (r - g) / d + 4;
  90. break;
  91. default:
  92. break;
  93. }
  94. h /= 6;
  95. }
  96. return { h, s, l };
  97. }
  98. function hue2rgb(p, q, t) {
  99. if (t < 0) {
  100. t += 1;
  101. }
  102. if (t > 1) {
  103. t -= 1;
  104. }
  105. if (t < 1 / 6) {
  106. return p + (q - p) * (6 * t);
  107. }
  108. if (t < 1 / 2) {
  109. return q;
  110. }
  111. if (t < 2 / 3) {
  112. return p + (q - p) * (2 / 3 - t) * 6;
  113. }
  114. return p;
  115. }
  116. function hslToRgb(h, s, l) {
  117. var r;
  118. var g;
  119. var b;
  120. h = bound01(h, 360);
  121. s = bound01(s, 100);
  122. l = bound01(l, 100);
  123. if (s === 0) {
  124. g = l;
  125. b = l;
  126. r = l;
  127. } else {
  128. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  129. var p = 2 * l - q;
  130. r = hue2rgb(p, q, h + 1 / 3);
  131. g = hue2rgb(p, q, h);
  132. b = hue2rgb(p, q, h - 1 / 3);
  133. }
  134. return { r: r * 255, g: g * 255, b: b * 255 };
  135. }
  136. function rgbToHsv(r, g, b) {
  137. r = bound01(r, 255);
  138. g = bound01(g, 255);
  139. b = bound01(b, 255);
  140. var max = Math.max(r, g, b);
  141. var min = Math.min(r, g, b);
  142. var h = 0;
  143. var v = max;
  144. var d = max - min;
  145. var s = max === 0 ? 0 : d / max;
  146. if (max === min) {
  147. h = 0;
  148. } else {
  149. switch (max) {
  150. case r:
  151. h = (g - b) / d + (g < b ? 6 : 0);
  152. break;
  153. case g:
  154. h = (b - r) / d + 2;
  155. break;
  156. case b:
  157. h = (r - g) / d + 4;
  158. break;
  159. default:
  160. break;
  161. }
  162. h /= 6;
  163. }
  164. return { h, s, v };
  165. }
  166. function hsvToRgb(h, s, v) {
  167. h = bound01(h, 360) * 6;
  168. s = bound01(s, 100);
  169. v = bound01(v, 100);
  170. var i = Math.floor(h);
  171. var f = h - i;
  172. var p = v * (1 - s);
  173. var q = v * (1 - f * s);
  174. var t = v * (1 - (1 - f) * s);
  175. var mod = i % 6;
  176. var r = [v, q, p, p, t, v][mod];
  177. var g = [t, v, v, q, p, p][mod];
  178. var b = [p, p, t, v, v, q][mod];
  179. return { r: r * 255, g: g * 255, b: b * 255 };
  180. }
  181. function rgbToHex(r, g, b, allow3Char) {
  182. var hex = [
  183. pad2(Math.round(r).toString(16)),
  184. pad2(Math.round(g).toString(16)),
  185. pad2(Math.round(b).toString(16))
  186. ];
  187. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
  188. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  189. }
  190. return hex.join("");
  191. }
  192. function rgbaToHex(r, g, b, a, allow4Char) {
  193. var hex = [
  194. pad2(Math.round(r).toString(16)),
  195. pad2(Math.round(g).toString(16)),
  196. pad2(Math.round(b).toString(16)),
  197. pad2(convertDecimalToHex(a))
  198. ];
  199. if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
  200. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  201. }
  202. return hex.join("");
  203. }
  204. function convertDecimalToHex(d) {
  205. return Math.round(parseFloat(d) * 255).toString(16);
  206. }
  207. function convertHexToDecimal(h) {
  208. return parseIntFromHex(h) / 255;
  209. }
  210. function parseIntFromHex(val) {
  211. return parseInt(val, 16);
  212. }
  213. function numberInputToObject(color) {
  214. return {
  215. r: color >> 16,
  216. g: (color & 65280) >> 8,
  217. b: color & 255
  218. };
  219. }
  220. // node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
  221. init_define_APP_INFO();
  222. var names = {
  223. aliceblue: "#f0f8ff",
  224. antiquewhite: "#faebd7",
  225. aqua: "#00ffff",
  226. aquamarine: "#7fffd4",
  227. azure: "#f0ffff",
  228. beige: "#f5f5dc",
  229. bisque: "#ffe4c4",
  230. black: "#000000",
  231. blanchedalmond: "#ffebcd",
  232. blue: "#0000ff",
  233. blueviolet: "#8a2be2",
  234. brown: "#a52a2a",
  235. burlywood: "#deb887",
  236. cadetblue: "#5f9ea0",
  237. chartreuse: "#7fff00",
  238. chocolate: "#d2691e",
  239. coral: "#ff7f50",
  240. cornflowerblue: "#6495ed",
  241. cornsilk: "#fff8dc",
  242. crimson: "#dc143c",
  243. cyan: "#00ffff",
  244. darkblue: "#00008b",
  245. darkcyan: "#008b8b",
  246. darkgoldenrod: "#b8860b",
  247. darkgray: "#a9a9a9",
  248. darkgreen: "#006400",
  249. darkgrey: "#a9a9a9",
  250. darkkhaki: "#bdb76b",
  251. darkmagenta: "#8b008b",
  252. darkolivegreen: "#556b2f",
  253. darkorange: "#ff8c00",
  254. darkorchid: "#9932cc",
  255. darkred: "#8b0000",
  256. darksalmon: "#e9967a",
  257. darkseagreen: "#8fbc8f",
  258. darkslateblue: "#483d8b",
  259. darkslategray: "#2f4f4f",
  260. darkslategrey: "#2f4f4f",
  261. darkturquoise: "#00ced1",
  262. darkviolet: "#9400d3",
  263. deeppink: "#ff1493",
  264. deepskyblue: "#00bfff",
  265. dimgray: "#696969",
  266. dimgrey: "#696969",
  267. dodgerblue: "#1e90ff",
  268. firebrick: "#b22222",
  269. floralwhite: "#fffaf0",
  270. forestgreen: "#228b22",
  271. fuchsia: "#ff00ff",
  272. gainsboro: "#dcdcdc",
  273. ghostwhite: "#f8f8ff",
  274. goldenrod: "#daa520",
  275. gold: "#ffd700",
  276. gray: "#808080",
  277. green: "#008000",
  278. greenyellow: "#adff2f",
  279. grey: "#808080",
  280. honeydew: "#f0fff0",
  281. hotpink: "#ff69b4",
  282. indianred: "#cd5c5c",
  283. indigo: "#4b0082",
  284. ivory: "#fffff0",
  285. khaki: "#f0e68c",
  286. lavenderblush: "#fff0f5",
  287. lavender: "#e6e6fa",
  288. lawngreen: "#7cfc00",
  289. lemonchiffon: "#fffacd",
  290. lightblue: "#add8e6",
  291. lightcoral: "#f08080",
  292. lightcyan: "#e0ffff",
  293. lightgoldenrodyellow: "#fafad2",
  294. lightgray: "#d3d3d3",
  295. lightgreen: "#90ee90",
  296. lightgrey: "#d3d3d3",
  297. lightpink: "#ffb6c1",
  298. lightsalmon: "#ffa07a",
  299. lightseagreen: "#20b2aa",
  300. lightskyblue: "#87cefa",
  301. lightslategray: "#778899",
  302. lightslategrey: "#778899",
  303. lightsteelblue: "#b0c4de",
  304. lightyellow: "#ffffe0",
  305. lime: "#00ff00",
  306. limegreen: "#32cd32",
  307. linen: "#faf0e6",
  308. magenta: "#ff00ff",
  309. maroon: "#800000",
  310. mediumaquamarine: "#66cdaa",
  311. mediumblue: "#0000cd",
  312. mediumorchid: "#ba55d3",
  313. mediumpurple: "#9370db",
  314. mediumseagreen: "#3cb371",
  315. mediumslateblue: "#7b68ee",
  316. mediumspringgreen: "#00fa9a",
  317. mediumturquoise: "#48d1cc",
  318. mediumvioletred: "#c71585",
  319. midnightblue: "#191970",
  320. mintcream: "#f5fffa",
  321. mistyrose: "#ffe4e1",
  322. moccasin: "#ffe4b5",
  323. navajowhite: "#ffdead",
  324. navy: "#000080",
  325. oldlace: "#fdf5e6",
  326. olive: "#808000",
  327. olivedrab: "#6b8e23",
  328. orange: "#ffa500",
  329. orangered: "#ff4500",
  330. orchid: "#da70d6",
  331. palegoldenrod: "#eee8aa",
  332. palegreen: "#98fb98",
  333. paleturquoise: "#afeeee",
  334. palevioletred: "#db7093",
  335. papayawhip: "#ffefd5",
  336. peachpuff: "#ffdab9",
  337. peru: "#cd853f",
  338. pink: "#ffc0cb",
  339. plum: "#dda0dd",
  340. powderblue: "#b0e0e6",
  341. purple: "#800080",
  342. rebeccapurple: "#663399",
  343. red: "#ff0000",
  344. rosybrown: "#bc8f8f",
  345. royalblue: "#4169e1",
  346. saddlebrown: "#8b4513",
  347. salmon: "#fa8072",
  348. sandybrown: "#f4a460",
  349. seagreen: "#2e8b57",
  350. seashell: "#fff5ee",
  351. sienna: "#a0522d",
  352. silver: "#c0c0c0",
  353. skyblue: "#87ceeb",
  354. slateblue: "#6a5acd",
  355. slategray: "#708090",
  356. slategrey: "#708090",
  357. snow: "#fffafa",
  358. springgreen: "#00ff7f",
  359. steelblue: "#4682b4",
  360. tan: "#d2b48c",
  361. teal: "#008080",
  362. thistle: "#d8bfd8",
  363. tomato: "#ff6347",
  364. turquoise: "#40e0d0",
  365. violet: "#ee82ee",
  366. wheat: "#f5deb3",
  367. white: "#ffffff",
  368. whitesmoke: "#f5f5f5",
  369. yellow: "#ffff00",
  370. yellowgreen: "#9acd32"
  371. };
  372. // node_modules/@ctrl/tinycolor/dist/module/format-input.js
  373. init_define_APP_INFO();
  374. function inputToRGB(color) {
  375. var rgb = { r: 0, g: 0, b: 0 };
  376. var a = 1;
  377. var s = null;
  378. var v = null;
  379. var l = null;
  380. var ok = false;
  381. var format = false;
  382. if (typeof color === "string") {
  383. color = stringInputToObject(color);
  384. }
  385. if (typeof color === "object") {
  386. if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
  387. rgb = rgbToRgb(color.r, color.g, color.b);
  388. ok = true;
  389. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
  390. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
  391. s = convertToPercentage(color.s);
  392. v = convertToPercentage(color.v);
  393. rgb = hsvToRgb(color.h, s, v);
  394. ok = true;
  395. format = "hsv";
  396. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
  397. s = convertToPercentage(color.s);
  398. l = convertToPercentage(color.l);
  399. rgb = hslToRgb(color.h, s, l);
  400. ok = true;
  401. format = "hsl";
  402. }
  403. if (Object.prototype.hasOwnProperty.call(color, "a")) {
  404. a = color.a;
  405. }
  406. }
  407. a = boundAlpha(a);
  408. return {
  409. ok,
  410. format: color.format || format,
  411. r: Math.min(255, Math.max(rgb.r, 0)),
  412. g: Math.min(255, Math.max(rgb.g, 0)),
  413. b: Math.min(255, Math.max(rgb.b, 0)),
  414. a
  415. };
  416. }
  417. var CSS_INTEGER = "[-\\+]?\\d+%?";
  418. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  419. var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
  420. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  421. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  422. var matchers = {
  423. CSS_UNIT: new RegExp(CSS_UNIT),
  424. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  425. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  426. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  427. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  428. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  429. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  430. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  431. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  432. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  433. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  434. };
  435. function stringInputToObject(color) {
  436. color = color.trim().toLowerCase();
  437. if (color.length === 0) {
  438. return false;
  439. }
  440. var named = false;
  441. if (names[color]) {
  442. color = names[color];
  443. named = true;
  444. } else if (color === "transparent") {
  445. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  446. }
  447. var match = matchers.rgb.exec(color);
  448. if (match) {
  449. return { r: match[1], g: match[2], b: match[3] };
  450. }
  451. match = matchers.rgba.exec(color);
  452. if (match) {
  453. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  454. }
  455. match = matchers.hsl.exec(color);
  456. if (match) {
  457. return { h: match[1], s: match[2], l: match[3] };
  458. }
  459. match = matchers.hsla.exec(color);
  460. if (match) {
  461. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  462. }
  463. match = matchers.hsv.exec(color);
  464. if (match) {
  465. return { h: match[1], s: match[2], v: match[3] };
  466. }
  467. match = matchers.hsva.exec(color);
  468. if (match) {
  469. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  470. }
  471. match = matchers.hex8.exec(color);
  472. if (match) {
  473. return {
  474. r: parseIntFromHex(match[1]),
  475. g: parseIntFromHex(match[2]),
  476. b: parseIntFromHex(match[3]),
  477. a: convertHexToDecimal(match[4]),
  478. format: named ? "name" : "hex8"
  479. };
  480. }
  481. match = matchers.hex6.exec(color);
  482. if (match) {
  483. return {
  484. r: parseIntFromHex(match[1]),
  485. g: parseIntFromHex(match[2]),
  486. b: parseIntFromHex(match[3]),
  487. format: named ? "name" : "hex"
  488. };
  489. }
  490. match = matchers.hex4.exec(color);
  491. if (match) {
  492. return {
  493. r: parseIntFromHex(match[1] + match[1]),
  494. g: parseIntFromHex(match[2] + match[2]),
  495. b: parseIntFromHex(match[3] + match[3]),
  496. a: convertHexToDecimal(match[4] + match[4]),
  497. format: named ? "name" : "hex8"
  498. };
  499. }
  500. match = matchers.hex3.exec(color);
  501. if (match) {
  502. return {
  503. r: parseIntFromHex(match[1] + match[1]),
  504. g: parseIntFromHex(match[2] + match[2]),
  505. b: parseIntFromHex(match[3] + match[3]),
  506. format: named ? "name" : "hex"
  507. };
  508. }
  509. return false;
  510. }
  511. function isValidCSSUnit(color) {
  512. return Boolean(matchers.CSS_UNIT.exec(String(color)));
  513. }
  514. // node_modules/@ctrl/tinycolor/dist/module/index.js
  515. var TinyColor = function() {
  516. function TinyColor2(color, opts) {
  517. if (color === void 0) {
  518. color = "";
  519. }
  520. if (opts === void 0) {
  521. opts = {};
  522. }
  523. var _a;
  524. if (color instanceof TinyColor2) {
  525. return color;
  526. }
  527. if (typeof color === "number") {
  528. color = numberInputToObject(color);
  529. }
  530. this.originalInput = color;
  531. var rgb = inputToRGB(color);
  532. this.originalInput = color;
  533. this.r = rgb.r;
  534. this.g = rgb.g;
  535. this.b = rgb.b;
  536. this.a = rgb.a;
  537. this.roundA = Math.round(100 * this.a) / 100;
  538. this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
  539. this.gradientType = opts.gradientType;
  540. if (this.r < 1) {
  541. this.r = Math.round(this.r);
  542. }
  543. if (this.g < 1) {
  544. this.g = Math.round(this.g);
  545. }
  546. if (this.b < 1) {
  547. this.b = Math.round(this.b);
  548. }
  549. this.isValid = rgb.ok;
  550. }
  551. TinyColor2.prototype.isDark = function() {
  552. return this.getBrightness() < 128;
  553. };
  554. TinyColor2.prototype.isLight = function() {
  555. return !this.isDark();
  556. };
  557. TinyColor2.prototype.getBrightness = function() {
  558. var rgb = this.toRgb();
  559. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  560. };
  561. TinyColor2.prototype.getLuminance = function() {
  562. var rgb = this.toRgb();
  563. var R;
  564. var G;
  565. var B;
  566. var RsRGB = rgb.r / 255;
  567. var GsRGB = rgb.g / 255;
  568. var BsRGB = rgb.b / 255;
  569. if (RsRGB <= 0.03928) {
  570. R = RsRGB / 12.92;
  571. } else {
  572. R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
  573. }
  574. if (GsRGB <= 0.03928) {
  575. G = GsRGB / 12.92;
  576. } else {
  577. G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
  578. }
  579. if (BsRGB <= 0.03928) {
  580. B = BsRGB / 12.92;
  581. } else {
  582. B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
  583. }
  584. return 0.2126 * R + 0.7152 * G + 0.0722 * B;
  585. };
  586. TinyColor2.prototype.getAlpha = function() {
  587. return this.a;
  588. };
  589. TinyColor2.prototype.setAlpha = function(alpha) {
  590. this.a = boundAlpha(alpha);
  591. this.roundA = Math.round(100 * this.a) / 100;
  592. return this;
  593. };
  594. TinyColor2.prototype.toHsv = function() {
  595. var hsv = rgbToHsv(this.r, this.g, this.b);
  596. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
  597. };
  598. TinyColor2.prototype.toHsvString = function() {
  599. var hsv = rgbToHsv(this.r, this.g, this.b);
  600. var h = Math.round(hsv.h * 360);
  601. var s = Math.round(hsv.s * 100);
  602. var v = Math.round(hsv.v * 100);
  603. return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  604. };
  605. TinyColor2.prototype.toHsl = function() {
  606. var hsl = rgbToHsl(this.r, this.g, this.b);
  607. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
  608. };
  609. TinyColor2.prototype.toHslString = function() {
  610. var hsl = rgbToHsl(this.r, this.g, this.b);
  611. var h = Math.round(hsl.h * 360);
  612. var s = Math.round(hsl.s * 100);
  613. var l = Math.round(hsl.l * 100);
  614. return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  615. };
  616. TinyColor2.prototype.toHex = function(allow3Char) {
  617. if (allow3Char === void 0) {
  618. allow3Char = false;
  619. }
  620. return rgbToHex(this.r, this.g, this.b, allow3Char);
  621. };
  622. TinyColor2.prototype.toHexString = function(allow3Char) {
  623. if (allow3Char === void 0) {
  624. allow3Char = false;
  625. }
  626. return "#" + this.toHex(allow3Char);
  627. };
  628. TinyColor2.prototype.toHex8 = function(allow4Char) {
  629. if (allow4Char === void 0) {
  630. allow4Char = false;
  631. }
  632. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  633. };
  634. TinyColor2.prototype.toHex8String = function(allow4Char) {
  635. if (allow4Char === void 0) {
  636. allow4Char = false;
  637. }
  638. return "#" + this.toHex8(allow4Char);
  639. };
  640. TinyColor2.prototype.toRgb = function() {
  641. return {
  642. r: Math.round(this.r),
  643. g: Math.round(this.g),
  644. b: Math.round(this.b),
  645. a: this.a
  646. };
  647. };
  648. TinyColor2.prototype.toRgbString = function() {
  649. var r = Math.round(this.r);
  650. var g = Math.round(this.g);
  651. var b = Math.round(this.b);
  652. return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  653. };
  654. TinyColor2.prototype.toPercentageRgb = function() {
  655. var fmt = function(x) {
  656. return "".concat(Math.round(bound01(x, 255) * 100), "%");
  657. };
  658. return {
  659. r: fmt(this.r),
  660. g: fmt(this.g),
  661. b: fmt(this.b),
  662. a: this.a
  663. };
  664. };
  665. TinyColor2.prototype.toPercentageRgbString = function() {
  666. var rnd = function(x) {
  667. return Math.round(bound01(x, 255) * 100);
  668. };
  669. return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
  670. };
  671. TinyColor2.prototype.toName = function() {
  672. if (this.a === 0) {
  673. return "transparent";
  674. }
  675. if (this.a < 1) {
  676. return false;
  677. }
  678. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  679. for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
  680. var _b = _a[_i], key = _b[0], value = _b[1];
  681. if (hex === value) {
  682. return key;
  683. }
  684. }
  685. return false;
  686. };
  687. TinyColor2.prototype.toString = function(format) {
  688. var formatSet = Boolean(format);
  689. format = format !== null && format !== void 0 ? format : this.format;
  690. var formattedString = false;
  691. var hasAlpha = this.a < 1 && this.a >= 0;
  692. var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith("hex") || format === "name");
  693. if (needsAlphaFormat) {
  694. if (format === "name" && this.a === 0) {
  695. return this.toName();
  696. }
  697. return this.toRgbString();
  698. }
  699. if (format === "rgb") {
  700. formattedString = this.toRgbString();
  701. }
  702. if (format === "prgb") {
  703. formattedString = this.toPercentageRgbString();
  704. }
  705. if (format === "hex" || format === "hex6") {
  706. formattedString = this.toHexString();
  707. }
  708. if (format === "hex3") {
  709. formattedString = this.toHexString(true);
  710. }
  711. if (format === "hex4") {
  712. formattedString = this.toHex8String(true);
  713. }
  714. if (format === "hex8") {
  715. formattedString = this.toHex8String();
  716. }
  717. if (format === "name") {
  718. formattedString = this.toName();
  719. }
  720. if (format === "hsl") {
  721. formattedString = this.toHslString();
  722. }
  723. if (format === "hsv") {
  724. formattedString = this.toHsvString();
  725. }
  726. return formattedString || this.toHexString();
  727. };
  728. TinyColor2.prototype.toNumber = function() {
  729. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  730. };
  731. TinyColor2.prototype.clone = function() {
  732. return new TinyColor2(this.toString());
  733. };
  734. TinyColor2.prototype.lighten = function(amount) {
  735. if (amount === void 0) {
  736. amount = 10;
  737. }
  738. var hsl = this.toHsl();
  739. hsl.l += amount / 100;
  740. hsl.l = clamp01(hsl.l);
  741. return new TinyColor2(hsl);
  742. };
  743. TinyColor2.prototype.brighten = function(amount) {
  744. if (amount === void 0) {
  745. amount = 10;
  746. }
  747. var rgb = this.toRgb();
  748. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  749. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  750. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  751. return new TinyColor2(rgb);
  752. };
  753. TinyColor2.prototype.darken = function(amount) {
  754. if (amount === void 0) {
  755. amount = 10;
  756. }
  757. var hsl = this.toHsl();
  758. hsl.l -= amount / 100;
  759. hsl.l = clamp01(hsl.l);
  760. return new TinyColor2(hsl);
  761. };
  762. TinyColor2.prototype.tint = function(amount) {
  763. if (amount === void 0) {
  764. amount = 10;
  765. }
  766. return this.mix("white", amount);
  767. };
  768. TinyColor2.prototype.shade = function(amount) {
  769. if (amount === void 0) {
  770. amount = 10;
  771. }
  772. return this.mix("black", amount);
  773. };
  774. TinyColor2.prototype.desaturate = function(amount) {
  775. if (amount === void 0) {
  776. amount = 10;
  777. }
  778. var hsl = this.toHsl();
  779. hsl.s -= amount / 100;
  780. hsl.s = clamp01(hsl.s);
  781. return new TinyColor2(hsl);
  782. };
  783. TinyColor2.prototype.saturate = function(amount) {
  784. if (amount === void 0) {
  785. amount = 10;
  786. }
  787. var hsl = this.toHsl();
  788. hsl.s += amount / 100;
  789. hsl.s = clamp01(hsl.s);
  790. return new TinyColor2(hsl);
  791. };
  792. TinyColor2.prototype.greyscale = function() {
  793. return this.desaturate(100);
  794. };
  795. TinyColor2.prototype.spin = function(amount) {
  796. var hsl = this.toHsl();
  797. var hue = (hsl.h + amount) % 360;
  798. hsl.h = hue < 0 ? 360 + hue : hue;
  799. return new TinyColor2(hsl);
  800. };
  801. TinyColor2.prototype.mix = function(color, amount) {
  802. if (amount === void 0) {
  803. amount = 50;
  804. }
  805. var rgb1 = this.toRgb();
  806. var rgb2 = new TinyColor2(color).toRgb();
  807. var p = amount / 100;
  808. var rgba = {
  809. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  810. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  811. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  812. a: (rgb2.a - rgb1.a) * p + rgb1.a
  813. };
  814. return new TinyColor2(rgba);
  815. };
  816. TinyColor2.prototype.analogous = function(results, slices) {
  817. if (results === void 0) {
  818. results = 6;
  819. }
  820. if (slices === void 0) {
  821. slices = 30;
  822. }
  823. var hsl = this.toHsl();
  824. var part = 360 / slices;
  825. var ret = [this];
  826. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
  827. hsl.h = (hsl.h + part) % 360;
  828. ret.push(new TinyColor2(hsl));
  829. }
  830. return ret;
  831. };
  832. TinyColor2.prototype.complement = function() {
  833. var hsl = this.toHsl();
  834. hsl.h = (hsl.h + 180) % 360;
  835. return new TinyColor2(hsl);
  836. };
  837. TinyColor2.prototype.monochromatic = function(results) {
  838. if (results === void 0) {
  839. results = 6;
  840. }
  841. var hsv = this.toHsv();
  842. var h = hsv.h;
  843. var s = hsv.s;
  844. var v = hsv.v;
  845. var res = [];
  846. var modification = 1 / results;
  847. while (results--) {
  848. res.push(new TinyColor2({ h, s, v }));
  849. v = (v + modification) % 1;
  850. }
  851. return res;
  852. };
  853. TinyColor2.prototype.splitcomplement = function() {
  854. var hsl = this.toHsl();
  855. var h = hsl.h;
  856. return [
  857. this,
  858. new TinyColor2({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
  859. new TinyColor2({ h: (h + 216) % 360, s: hsl.s, l: hsl.l })
  860. ];
  861. };
  862. TinyColor2.prototype.onBackground = function(background) {
  863. var fg = this.toRgb();
  864. var bg = new TinyColor2(background).toRgb();
  865. return new TinyColor2({
  866. r: bg.r + (fg.r - bg.r) * fg.a,
  867. g: bg.g + (fg.g - bg.g) * fg.a,
  868. b: bg.b + (fg.b - bg.b) * fg.a
  869. });
  870. };
  871. TinyColor2.prototype.triad = function() {
  872. return this.polyad(3);
  873. };
  874. TinyColor2.prototype.tetrad = function() {
  875. return this.polyad(4);
  876. };
  877. TinyColor2.prototype.polyad = function(n) {
  878. var hsl = this.toHsl();
  879. var h = hsl.h;
  880. var result = [this];
  881. var increment = 360 / n;
  882. for (var i = 1; i < n; i++) {
  883. result.push(new TinyColor2({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));
  884. }
  885. return result;
  886. };
  887. TinyColor2.prototype.equals = function(color) {
  888. return this.toRgbString() === new TinyColor2(color).toRgbString();
  889. };
  890. return TinyColor2;
  891. }();
  892. // node_modules/@ctrl/tinycolor/dist/module/readability.js
  893. init_define_APP_INFO();
  894. // node_modules/@ctrl/tinycolor/dist/module/to-ms-filter.js
  895. init_define_APP_INFO();
  896. // node_modules/@ctrl/tinycolor/dist/module/from-ratio.js
  897. init_define_APP_INFO();
  898. // node_modules/@ctrl/tinycolor/dist/module/random.js
  899. init_define_APP_INFO();
  900. // node_modules/@ctrl/tinycolor/dist/module/interfaces.js
  901. init_define_APP_INFO();
  902. // node_modules/@ant-design/colors/dist/index.esm.js
  903. var hueStep = 2;
  904. var saturationStep = 0.16;
  905. var saturationStep2 = 0.05;
  906. var brightnessStep1 = 0.05;
  907. var brightnessStep2 = 0.15;
  908. var lightColorCount = 5;
  909. var darkColorCount = 4;
  910. var darkColorMap = [{
  911. index: 7,
  912. opacity: 0.15
  913. }, {
  914. index: 6,
  915. opacity: 0.25
  916. }, {
  917. index: 5,
  918. opacity: 0.3
  919. }, {
  920. index: 5,
  921. opacity: 0.45
  922. }, {
  923. index: 5,
  924. opacity: 0.65
  925. }, {
  926. index: 5,
  927. opacity: 0.85
  928. }, {
  929. index: 4,
  930. opacity: 0.9
  931. }, {
  932. index: 3,
  933. opacity: 0.95
  934. }, {
  935. index: 2,
  936. opacity: 0.97
  937. }, {
  938. index: 1,
  939. opacity: 0.98
  940. }];
  941. function toHsv(_ref) {
  942. var r = _ref.r, g = _ref.g, b = _ref.b;
  943. var hsv = rgbToHsv(r, g, b);
  944. return {
  945. h: hsv.h * 360,
  946. s: hsv.s,
  947. v: hsv.v
  948. };
  949. }
  950. function toHex(_ref2) {
  951. var r = _ref2.r, g = _ref2.g, b = _ref2.b;
  952. return "#".concat(rgbToHex(r, g, b, false));
  953. }
  954. function mix(rgb1, rgb2, amount) {
  955. var p = amount / 100;
  956. var rgb = {
  957. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  958. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  959. b: (rgb2.b - rgb1.b) * p + rgb1.b
  960. };
  961. return rgb;
  962. }
  963. function getHue(hsv, i, light) {
  964. var hue;
  965. if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
  966. hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
  967. } else {
  968. hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
  969. }
  970. if (hue < 0) {
  971. hue += 360;
  972. } else if (hue >= 360) {
  973. hue -= 360;
  974. }
  975. return hue;
  976. }
  977. function getSaturation(hsv, i, light) {
  978. if (hsv.h === 0 && hsv.s === 0) {
  979. return hsv.s;
  980. }
  981. var saturation;
  982. if (light) {
  983. saturation = hsv.s - saturationStep * i;
  984. } else if (i === darkColorCount) {
  985. saturation = hsv.s + saturationStep;
  986. } else {
  987. saturation = hsv.s + saturationStep2 * i;
  988. }
  989. if (saturation > 1) {
  990. saturation = 1;
  991. }
  992. if (light && i === lightColorCount && saturation > 0.1) {
  993. saturation = 0.1;
  994. }
  995. if (saturation < 0.06) {
  996. saturation = 0.06;
  997. }
  998. return Number(saturation.toFixed(2));
  999. }
  1000. function getValue(hsv, i, light) {
  1001. var value;
  1002. if (light) {
  1003. value = hsv.v + brightnessStep1 * i;
  1004. } else {
  1005. value = hsv.v - brightnessStep2 * i;
  1006. }
  1007. if (value > 1) {
  1008. value = 1;
  1009. }
  1010. return Number(value.toFixed(2));
  1011. }
  1012. function generate(color) {
  1013. var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  1014. var patterns = [];
  1015. var pColor = inputToRGB(color);
  1016. for (var i = lightColorCount; i > 0; i -= 1) {
  1017. var hsv = toHsv(pColor);
  1018. var colorString = toHex(inputToRGB({
  1019. h: getHue(hsv, i, true),
  1020. s: getSaturation(hsv, i, true),
  1021. v: getValue(hsv, i, true)
  1022. }));
  1023. patterns.push(colorString);
  1024. }
  1025. patterns.push(toHex(pColor));
  1026. for (var _i = 1; _i <= darkColorCount; _i += 1) {
  1027. var _hsv = toHsv(pColor);
  1028. var _colorString = toHex(inputToRGB({
  1029. h: getHue(_hsv, _i),
  1030. s: getSaturation(_hsv, _i),
  1031. v: getValue(_hsv, _i)
  1032. }));
  1033. patterns.push(_colorString);
  1034. }
  1035. if (opts.theme === "dark") {
  1036. return darkColorMap.map(function(_ref3) {
  1037. var index = _ref3.index, opacity = _ref3.opacity;
  1038. var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index]), opacity * 100));
  1039. return darkColorString;
  1040. });
  1041. }
  1042. return patterns;
  1043. }
  1044. var presetPrimaryColors = {
  1045. red: "#F5222D",
  1046. volcano: "#FA541C",
  1047. orange: "#FA8C16",
  1048. gold: "#FAAD14",
  1049. yellow: "#FADB14",
  1050. lime: "#A0D911",
  1051. green: "#52C41A",
  1052. cyan: "#13C2C2",
  1053. blue: "#1890FF",
  1054. geekblue: "#2F54EB",
  1055. purple: "#722ED1",
  1056. magenta: "#EB2F96",
  1057. grey: "#666666"
  1058. };
  1059. var presetPalettes = {};
  1060. var presetDarkPalettes = {};
  1061. Object.keys(presetPrimaryColors).forEach(function(key) {
  1062. presetPalettes[key] = generate(presetPrimaryColors[key]);
  1063. presetPalettes[key].primary = presetPalettes[key][5];
  1064. presetDarkPalettes[key] = generate(presetPrimaryColors[key], {
  1065. theme: "dark",
  1066. backgroundColor: "#141414"
  1067. });
  1068. presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
  1069. });
  1070. var red = presetPalettes.red;
  1071. var volcano = presetPalettes.volcano;
  1072. var gold = presetPalettes.gold;
  1073. var orange = presetPalettes.orange;
  1074. var yellow = presetPalettes.yellow;
  1075. var lime = presetPalettes.lime;
  1076. var green = presetPalettes.green;
  1077. var cyan = presetPalettes.cyan;
  1078. var blue = presetPalettes.blue;
  1079. var geekblue = presetPalettes.geekblue;
  1080. var purple = presetPalettes.purple;
  1081. var magenta = presetPalettes.magenta;
  1082. var grey = presetPalettes.grey;
  1083. export {
  1084. TinyColor,
  1085. generate,
  1086. presetPrimaryColors,
  1087. presetPalettes,
  1088. presetDarkPalettes,
  1089. red,
  1090. volcano,
  1091. gold,
  1092. orange,
  1093. yellow,
  1094. lime,
  1095. green,
  1096. cyan,
  1097. blue,
  1098. geekblue,
  1099. purple,
  1100. magenta,
  1101. grey
  1102. };
  1103. //# sourceMappingURL=chunk-XH73JGLD.js.map