cck-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -0
- package/README.md +3 -0
- package/dist/index.css +1 -0
- package/dist/index.full.js +2957 -0
- package/dist/index.full.min.js +21 -0
- package/dist/index.full.min.js.map +1 -0
- package/dist/index.full.min.mjs +21 -0
- package/dist/index.full.min.mjs.map +1 -0
- package/dist/index.full.mjs +2945 -0
- package/es/_virtual/_rolldown/runtime.mjs +27 -0
- package/es/component.d.ts +6 -0
- package/es/component.mjs +8 -0
- package/es/component.mjs.map +1 -0
- package/es/components/base/style/css.mjs +1 -0
- package/es/components/base/style/index.mjs +1 -0
- package/es/components/button/index.d.ts +8 -0
- package/es/components/button/src/button-custom.d.ts +6 -0
- package/es/components/button/src/button.types.d.ts +77 -0
- package/es/components/button/src/button.vue.d.ts +28 -0
- package/es/components/button/src/use-button.d.ts +14 -0
- package/es/components/button/style/css.mjs +2 -0
- package/es/components/form/index.d.ts +4 -0
- package/es/components/form/src/constants.d.ts +7 -0
- package/es/components/form/src/form.types.d.ts +10 -0
- package/es/components/form/src/hooks/index.d.ts +2 -0
- package/es/components/form/src/hooks/use-form-common-props.d.ts +7 -0
- package/es/components/icon/index.d.ts +26 -0
- package/es/components/icon/src/icon.types.d.ts +13 -0
- package/es/components/icon/src/icon.vue.d.ts +17 -0
- package/es/components/icon/style/css.mjs +1 -0
- package/es/components/icon/style/index.mjs +1 -0
- package/es/components/index.d.ts +5 -0
- package/es/constants/index.d.ts +3 -0
- package/es/constants/key.d.ts +4 -0
- package/es/constants/sizes.d.ts +12 -0
- package/es/defaults.d.ts +6 -0
- package/es/defaults.mjs +9 -0
- package/es/defaults.mjs.map +1 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/use-namespace/index.d.ts +27 -0
- package/es/hooks/use-prop/index.d.ts +6 -0
- package/es/hooks/use-theme/index.d.ts +5 -0
- package/es/index.d.ts +11 -0
- package/es/index.mjs +11 -0
- package/es/index.mjs.map +1 -0
- package/es/make-installer.d.ts +8 -0
- package/es/make-installer.mjs +14 -0
- package/es/make-installer.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/conversion.mjs +268 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/conversion.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.mjs +158 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/format-input.mjs +192 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/format-input.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/index.mjs +456 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/util.mjs +65 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/util.mjs.map +1 -0
- package/es/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs +53 -0
- package/es/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs.map +1 -0
- package/es/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs +22 -0
- package/es/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs.map +1 -0
- package/es/packages/components/button/index.mjs +8 -0
- package/es/packages/components/button/index.mjs.map +1 -0
- package/es/packages/components/button/src/button-custom.mjs +121 -0
- package/es/packages/components/button/src/button-custom.mjs.map +1 -0
- package/es/packages/components/button/src/button.mjs +7 -0
- package/es/packages/components/button/src/button.mjs.map +1 -0
- package/es/packages/components/button/src/button.types.mjs +0 -0
- package/es/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.mjs +139 -0
- package/es/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/packages/components/button/src/use-button.mjs +41 -0
- package/es/packages/components/button/src/use-button.mjs.map +1 -0
- package/es/packages/components/form/index.mjs +3 -0
- package/es/packages/components/form/src/constants.mjs +6 -0
- package/es/packages/components/form/src/constants.mjs.map +1 -0
- package/es/packages/components/form/src/form.types.mjs +0 -0
- package/es/packages/components/form/src/hooks/index.mjs +2 -0
- package/es/packages/components/form/src/hooks/use-form-common-props.mjs +16 -0
- package/es/packages/components/form/src/hooks/use-form-common-props.mjs.map +1 -0
- package/es/packages/components/icon/index.mjs +8 -0
- package/es/packages/components/icon/index.mjs.map +1 -0
- package/es/packages/components/icon/src/icon.mjs +7 -0
- package/es/packages/components/icon/src/icon.mjs.map +1 -0
- package/es/packages/components/icon/src/icon.types.mjs +0 -0
- package/es/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs +42 -0
- package/es/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/packages/components/index.mjs +3 -0
- package/es/packages/constants/index.mjs +3 -0
- package/es/packages/constants/key.mjs +6 -0
- package/es/packages/constants/key.mjs.map +1 -0
- package/es/packages/constants/sizes.mjs +24 -0
- package/es/packages/constants/sizes.mjs.map +1 -0
- package/es/packages/hooks/index.mjs +4 -0
- package/es/packages/hooks/use-namespace/index.mjs +63 -0
- package/es/packages/hooks/use-namespace/index.mjs.map +1 -0
- package/es/packages/hooks/use-prop/index.mjs +10 -0
- package/es/packages/hooks/use-prop/index.mjs.map +1 -0
- package/es/packages/hooks/use-theme/index.mjs +19 -0
- package/es/packages/hooks/use-theme/index.mjs.map +1 -0
- package/es/packages/utils/colors.mjs +109 -0
- package/es/packages/utils/colors.mjs.map +1 -0
- package/es/packages/utils/dom/index.mjs +2 -0
- package/es/packages/utils/dom/style.mjs +11 -0
- package/es/packages/utils/dom/style.mjs.map +1 -0
- package/es/packages/utils/index.mjs +5 -0
- package/es/packages/utils/types.mjs +12 -0
- package/es/packages/utils/types.mjs.map +1 -0
- package/es/packages/utils/vue/index.mjs +2 -0
- package/es/packages/utils/vue/install.mjs +38 -0
- package/es/packages/utils/vue/install.mjs.map +1 -0
- package/es/packages/utils/vue/typescript.mjs +0 -0
- package/es/plugin.d.ts +6 -0
- package/es/plugin.mjs +6 -0
- package/es/plugin.mjs.map +1 -0
- package/es/utils/colors.d.ts +14 -0
- package/es/utils/dom/index.d.ts +2 -0
- package/es/utils/dom/style.d.ts +4 -0
- package/es/utils/index.d.ts +6 -0
- package/es/utils/types.d.ts +8 -0
- package/es/utils/vue/index.d.ts +3 -0
- package/es/utils/vue/install.d.ts +7 -0
- package/es/utils/vue/typescript.d.ts +19 -0
- package/global.d.ts +8 -0
- package/lib/_virtual/_rolldown/runtime.js +37 -0
- package/lib/component.d.ts +6 -0
- package/lib/component.js +12 -0
- package/lib/component.js.map +1 -0
- package/lib/components/base/style/css.js +2 -0
- package/lib/components/base/style/index.js +2 -0
- package/lib/components/button/index.d.ts +8 -0
- package/lib/components/button/src/button-custom.d.ts +6 -0
- package/lib/components/button/src/button.types.d.ts +77 -0
- package/lib/components/button/src/button.vue.d.ts +28 -0
- package/lib/components/button/src/use-button.d.ts +14 -0
- package/lib/components/button/style/css.js +3 -0
- package/lib/components/form/index.d.ts +4 -0
- package/lib/components/form/src/constants.d.ts +7 -0
- package/lib/components/form/src/form.types.d.ts +10 -0
- package/lib/components/form/src/hooks/index.d.ts +2 -0
- package/lib/components/form/src/hooks/use-form-common-props.d.ts +7 -0
- package/lib/components/icon/index.d.ts +26 -0
- package/lib/components/icon/src/icon.types.d.ts +13 -0
- package/lib/components/icon/src/icon.vue.d.ts +17 -0
- package/lib/components/icon/style/css.js +2 -0
- package/lib/components/icon/style/index.js +2 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/key.d.ts +4 -0
- package/lib/constants/sizes.d.ts +12 -0
- package/lib/defaults.d.ts +6 -0
- package/lib/defaults.js +13 -0
- package/lib/defaults.js.map +1 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/use-namespace/index.d.ts +27 -0
- package/lib/hooks/use-prop/index.d.ts +6 -0
- package/lib/hooks/use-theme/index.d.ts +5 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/make-installer.d.ts +8 -0
- package/lib/make-installer.js +15 -0
- package/lib/make-installer.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/conversion.js +309 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/conversion.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/css-color-names.js +168 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/css-color-names.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/format-input.js +209 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/format-input.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js +43 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/index.js +471 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/index.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/interfaces.js +14 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/interfaces.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/public_api.js +50 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/public_api.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/random.js +255 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/random.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/readability.js +96 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/readability.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js +35 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/util.js +82 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/util.js.map +1 -0
- package/lib/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.js +53 -0
- package/lib/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.js +66 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.prod.js +56 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.prod.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index.js +18 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js +14 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js.map +1 -0
- package/lib/packages/components/button/index.js +13 -0
- package/lib/packages/components/button/index.js.map +1 -0
- package/lib/packages/components/button/src/button-custom.js +122 -0
- package/lib/packages/components/button/src/button-custom.js.map +1 -0
- package/lib/packages/components/button/src/button.js +10 -0
- package/lib/packages/components/button/src/button.js.map +1 -0
- package/lib/packages/components/button/src/button.types.js +1 -0
- package/lib/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.js +139 -0
- package/lib/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/lib/packages/components/button/src/use-button.js +42 -0
- package/lib/packages/components/button/src/use-button.js.map +1 -0
- package/lib/packages/components/form/index.js +6 -0
- package/lib/packages/components/form/src/constants.js +7 -0
- package/lib/packages/components/form/src/constants.js.map +1 -0
- package/lib/packages/components/form/src/form.types.js +1 -0
- package/lib/packages/components/form/src/hooks/index.js +4 -0
- package/lib/packages/components/form/src/hooks/use-form-common-props.js +18 -0
- package/lib/packages/components/form/src/hooks/use-form-common-props.js.map +1 -0
- package/lib/packages/components/icon/index.js +13 -0
- package/lib/packages/components/icon/index.js.map +1 -0
- package/lib/packages/components/icon/src/icon.js +10 -0
- package/lib/packages/components/icon/src/icon.js.map +1 -0
- package/lib/packages/components/icon/src/icon.types.js +1 -0
- package/lib/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js +42 -0
- package/lib/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/lib/packages/components/index.js +5 -0
- package/lib/packages/constants/index.js +6 -0
- package/lib/packages/constants/key.js +7 -0
- package/lib/packages/constants/key.js.map +1 -0
- package/lib/packages/constants/sizes.js +26 -0
- package/lib/packages/constants/sizes.js.map +1 -0
- package/lib/packages/hooks/index.js +10 -0
- package/lib/packages/hooks/use-namespace/index.js +67 -0
- package/lib/packages/hooks/use-namespace/index.js.map +1 -0
- package/lib/packages/hooks/use-prop/index.js +11 -0
- package/lib/packages/hooks/use-prop/index.js.map +1 -0
- package/lib/packages/hooks/use-theme/index.js +20 -0
- package/lib/packages/hooks/use-theme/index.js.map +1 -0
- package/lib/packages/utils/colors.js +112 -0
- package/lib/packages/utils/colors.js.map +1 -0
- package/lib/packages/utils/dom/index.js +3 -0
- package/lib/packages/utils/dom/style.js +13 -0
- package/lib/packages/utils/dom/style.js.map +1 -0
- package/lib/packages/utils/index.js +21 -0
- package/lib/packages/utils/types.js +21 -0
- package/lib/packages/utils/types.js.map +1 -0
- package/lib/packages/utils/vue/index.js +4 -0
- package/lib/packages/utils/vue/install.js +40 -0
- package/lib/packages/utils/vue/install.js.map +1 -0
- package/lib/packages/utils/vue/typescript.js +1 -0
- package/lib/plugin.d.ts +6 -0
- package/lib/plugin.js +10 -0
- package/lib/plugin.js.map +1 -0
- package/lib/utils/colors.d.ts +14 -0
- package/lib/utils/dom/index.d.ts +2 -0
- package/lib/utils/dom/style.d.ts +4 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/types.d.ts +8 -0
- package/lib/utils/vue/index.d.ts +3 -0
- package/lib/utils/vue/install.d.ts +7 -0
- package/lib/utils/vue/typescript.d.ts +19 -0
- package/package.json +69 -0
- package/theme-slate/base.css +1 -0
- package/theme-slate/cu-button.css +1 -0
- package/theme-slate/cu-common.css +1 -0
- package/theme-slate/cu-icon.css +1 -0
- package/theme-slate/cu-var.css +1 -0
- package/theme-slate/dark/css-vars.css +0 -0
- package/theme-slate/index.css +1 -0
- package/theme-slate/src/base.scss +2 -0
- package/theme-slate/src/button.scss +317 -0
- package/theme-slate/src/common/var.scss +179 -0
- package/theme-slate/src/common.scss +9 -0
- package/theme-slate/src/dark/css-vars.scss +0 -0
- package/theme-slate/src/icon.scss +43 -0
- package/theme-slate/src/index.scss +4 -0
- package/theme-slate/src/mixins/_var.scss +9 -0
- package/theme-slate/src/mixins/config.scss +5 -0
- package/theme-slate/src/mixins/function.scss +11 -0
- package/theme-slate/src/mixins/mixins.scss +19 -0
- package/theme-slate/src/var.scss +297 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversion.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/conversion.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.numberInputToObject = exports.parseIntFromHex = exports.convertHexToDecimal = exports.convertDecimalToHex = exports.rgbToCmyk = exports.cmykToRgb = exports.rgbaToArgbHex = exports.rgbaToHex = exports.rgbToHex = exports.hsvToRgb = exports.rgbToHsv = exports.hslToRgb = exports.rgbToHsl = exports.rgbToRgb = void 0;\nconst util_js_1 = require(\"./util.js\");\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n/**\n * Handle bounds / percentage checking to conform to CSS color spec\n * <http://www.w3.org/TR/css3-color/>\n * *Assumes:* r, g, b in [0, 255] or [0, 1]\n * *Returns:* { r, g, b } in [0, 255]\n */\nfunction rgbToRgb(r, g, b) {\n return {\n r: (0, util_js_1.bound01)(r, 255) * 255,\n g: (0, util_js_1.bound01)(g, 255) * 255,\n b: (0, util_js_1.bound01)(b, 255) * 255,\n };\n}\nexports.rgbToRgb = rgbToRgb;\n/**\n * Converts an RGB color value to HSL.\n * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n * *Returns:* { h, s, l } in [0,1]\n */\nfunction rgbToHsl(r, g, b) {\n r = (0, util_js_1.bound01)(r, 255);\n g = (0, util_js_1.bound01)(g, 255);\n b = (0, util_js_1.bound01)(b, 255);\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0;\n let s = 0;\n const l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = 0; // achromatic\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h, s, l };\n}\nexports.rgbToHsl = rgbToHsl;\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * (6 * t);\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n/**\n * Converts an HSL color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nfunction hslToRgb(h, s, l) {\n let r;\n let g;\n let b;\n h = (0, util_js_1.bound01)(h, 360);\n s = (0, util_js_1.bound01)(s, 100);\n l = (0, util_js_1.bound01)(l, 100);\n if (s === 0) {\n // achromatic\n g = l;\n b = l;\n r = l;\n }\n else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\nexports.hslToRgb = hslToRgb;\n/**\n * Converts an RGB color value to HSV\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n * *Returns:* { h, s, v } in [0,1]\n */\nfunction rgbToHsv(r, g, b) {\n r = (0, util_js_1.bound01)(r, 255);\n g = (0, util_js_1.bound01)(g, 255);\n b = (0, util_js_1.bound01)(b, 255);\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0;\n const v = max;\n const d = max - min;\n const s = max === 0 ? 0 : d / max;\n if (max === min) {\n h = 0; // achromatic\n }\n else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h, s, v };\n}\nexports.rgbToHsv = rgbToHsv;\n/**\n * Converts an HSV color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nfunction hsvToRgb(h, s, v) {\n h = (0, util_js_1.bound01)(h, 360) * 6;\n s = (0, util_js_1.bound01)(s, 100);\n v = (0, util_js_1.bound01)(v, 100);\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\nexports.hsvToRgb = hsvToRgb;\n/**\n * Converts an RGB color to hex\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255]\n * *Returns:* a 3 or 6 character hex\n */\nfunction rgbToHex(r, g, b, allow3Char) {\n const hex = [\n (0, util_js_1.pad2)(Math.round(r).toString(16)),\n (0, util_js_1.pad2)(Math.round(g).toString(16)),\n (0, util_js_1.pad2)(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join('');\n}\nexports.rgbToHex = rgbToHex;\n/**\n * Converts an RGBA color plus alpha transparency to hex\n *\n * *Assumes:* r, g, b are contained in the set [0, 255] and a in [0, 1]\n * *Returns:* a 4 or 8 character rgba hex\n */\n// eslint-disable-next-line max-params\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n const hex = [\n (0, util_js_1.pad2)(Math.round(r).toString(16)),\n (0, util_js_1.pad2)(Math.round(g).toString(16)),\n (0, util_js_1.pad2)(Math.round(b).toString(16)),\n (0, util_js_1.pad2)(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n}\nexports.rgbaToHex = rgbaToHex;\n/**\n * Converts an RGBA color to an ARGB Hex8 string\n * Rarely used, but required for \"toFilter()\"\n *\n * *Assumes:* r, g, b are contained in the set [0, 255] and a in [0, 1]\n * *Returns:* a 8 character argb hex\n */\nfunction rgbaToArgbHex(r, g, b, a) {\n const hex = [\n (0, util_js_1.pad2)(convertDecimalToHex(a)),\n (0, util_js_1.pad2)(Math.round(r).toString(16)),\n (0, util_js_1.pad2)(Math.round(g).toString(16)),\n (0, util_js_1.pad2)(Math.round(b).toString(16)),\n ];\n return hex.join('');\n}\nexports.rgbaToArgbHex = rgbaToArgbHex;\n/**\n * Converts CMYK to RBG\n * Assumes c, m, y, k are in the set [0, 100]\n */\nfunction cmykToRgb(c, m, y, k) {\n const cConv = c / 100;\n const mConv = m / 100;\n const yConv = y / 100;\n const kConv = k / 100;\n const r = 255 * (1 - cConv) * (1 - kConv);\n const g = 255 * (1 - mConv) * (1 - kConv);\n const b = 255 * (1 - yConv) * (1 - kConv);\n return { r, g, b };\n}\nexports.cmykToRgb = cmykToRgb;\nfunction rgbToCmyk(r, g, b) {\n let c = 1 - r / 255;\n let m = 1 - g / 255;\n let y = 1 - b / 255;\n let k = Math.min(c, m, y);\n if (k === 1) {\n c = 0;\n m = 0;\n y = 0;\n }\n else {\n c = ((c - k) / (1 - k)) * 100;\n m = ((m - k) / (1 - k)) * 100;\n y = ((y - k) / (1 - k)) * 100;\n }\n k *= 100;\n return {\n c: Math.round(c),\n m: Math.round(m),\n y: Math.round(y),\n k: Math.round(k),\n };\n}\nexports.rgbToCmyk = rgbToCmyk;\n/** Converts a decimal to a hex value */\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\nexports.convertDecimalToHex = convertDecimalToHex;\n/** Converts a hex value to a decimal */\nfunction convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\nexports.convertHexToDecimal = convertHexToDecimal;\n/** Parse a base-16 hex value into a base-10 integer */\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\nexports.parseIntFromHex = parseIntFromHex;\nfunction numberInputToObject(color) {\n return {\n r: color >> 16,\n g: (color & 0xff00) >> 8,\n b: color & 0xff,\n };\n}\nexports.numberInputToObject = numberInputToObject;\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,sBAAsB,QAA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AG,KAAK,MAAM,CAAC;GACf,GAAG,KAAK,MAAM,CAAC;GACf,GAAG,KAAK,MAAM,CAAC;GACf,GAAG,KAAK,MAAM,CAAC;EACnB;CACJ;CACA,QAAQ,YAAY;;CAEpB,SAAS,oBAAoB,GAAG;EAC5B,OAAO,KAAK,MAAM,WAAW,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE;CACtD;CACA,QAAQ,sBAAsB;;CAE9B,SAAS,oBAAoB,GAAG;EAC5B,OAAO,gBAAgB,CAAC,IAAI;CAChC;CACA,QAAQ,sBAAsB;;CAE9B,SAAS,gBAAgB,KAAK;EAC1B,OAAO,SAAS,KAAK,EAAE;CAC3B;CACA,QAAQ,kBAAkB;CAC1B,SAAS,oBAAoB,OAAO;EAChC,OAAO;GACH,GAAG,SAAS;GACZ,IAAI,QAAQ,UAAW;GACvB,GAAG,QAAQ;EACf;CACJ;CACA,QAAQ,sBAAsB"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/css-color-names.js
|
|
3
|
+
var require_css_color_names = /* @__PURE__ */ require("../../../../../../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports) => {
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.names = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
exports.names = {
|
|
10
|
+
aliceblue: "#f0f8ff",
|
|
11
|
+
antiquewhite: "#faebd7",
|
|
12
|
+
aqua: "#00ffff",
|
|
13
|
+
aquamarine: "#7fffd4",
|
|
14
|
+
azure: "#f0ffff",
|
|
15
|
+
beige: "#f5f5dc",
|
|
16
|
+
bisque: "#ffe4c4",
|
|
17
|
+
black: "#000000",
|
|
18
|
+
blanchedalmond: "#ffebcd",
|
|
19
|
+
blue: "#0000ff",
|
|
20
|
+
blueviolet: "#8a2be2",
|
|
21
|
+
brown: "#a52a2a",
|
|
22
|
+
burlywood: "#deb887",
|
|
23
|
+
cadetblue: "#5f9ea0",
|
|
24
|
+
chartreuse: "#7fff00",
|
|
25
|
+
chocolate: "#d2691e",
|
|
26
|
+
coral: "#ff7f50",
|
|
27
|
+
cornflowerblue: "#6495ed",
|
|
28
|
+
cornsilk: "#fff8dc",
|
|
29
|
+
crimson: "#dc143c",
|
|
30
|
+
cyan: "#00ffff",
|
|
31
|
+
darkblue: "#00008b",
|
|
32
|
+
darkcyan: "#008b8b",
|
|
33
|
+
darkgoldenrod: "#b8860b",
|
|
34
|
+
darkgray: "#a9a9a9",
|
|
35
|
+
darkgreen: "#006400",
|
|
36
|
+
darkgrey: "#a9a9a9",
|
|
37
|
+
darkkhaki: "#bdb76b",
|
|
38
|
+
darkmagenta: "#8b008b",
|
|
39
|
+
darkolivegreen: "#556b2f",
|
|
40
|
+
darkorange: "#ff8c00",
|
|
41
|
+
darkorchid: "#9932cc",
|
|
42
|
+
darkred: "#8b0000",
|
|
43
|
+
darksalmon: "#e9967a",
|
|
44
|
+
darkseagreen: "#8fbc8f",
|
|
45
|
+
darkslateblue: "#483d8b",
|
|
46
|
+
darkslategray: "#2f4f4f",
|
|
47
|
+
darkslategrey: "#2f4f4f",
|
|
48
|
+
darkturquoise: "#00ced1",
|
|
49
|
+
darkviolet: "#9400d3",
|
|
50
|
+
deeppink: "#ff1493",
|
|
51
|
+
deepskyblue: "#00bfff",
|
|
52
|
+
dimgray: "#696969",
|
|
53
|
+
dimgrey: "#696969",
|
|
54
|
+
dodgerblue: "#1e90ff",
|
|
55
|
+
firebrick: "#b22222",
|
|
56
|
+
floralwhite: "#fffaf0",
|
|
57
|
+
forestgreen: "#228b22",
|
|
58
|
+
fuchsia: "#ff00ff",
|
|
59
|
+
gainsboro: "#dcdcdc",
|
|
60
|
+
ghostwhite: "#f8f8ff",
|
|
61
|
+
goldenrod: "#daa520",
|
|
62
|
+
gold: "#ffd700",
|
|
63
|
+
gray: "#808080",
|
|
64
|
+
green: "#008000",
|
|
65
|
+
greenyellow: "#adff2f",
|
|
66
|
+
grey: "#808080",
|
|
67
|
+
honeydew: "#f0fff0",
|
|
68
|
+
hotpink: "#ff69b4",
|
|
69
|
+
indianred: "#cd5c5c",
|
|
70
|
+
indigo: "#4b0082",
|
|
71
|
+
ivory: "#fffff0",
|
|
72
|
+
khaki: "#f0e68c",
|
|
73
|
+
lavenderblush: "#fff0f5",
|
|
74
|
+
lavender: "#e6e6fa",
|
|
75
|
+
lawngreen: "#7cfc00",
|
|
76
|
+
lemonchiffon: "#fffacd",
|
|
77
|
+
lightblue: "#add8e6",
|
|
78
|
+
lightcoral: "#f08080",
|
|
79
|
+
lightcyan: "#e0ffff",
|
|
80
|
+
lightgoldenrodyellow: "#fafad2",
|
|
81
|
+
lightgray: "#d3d3d3",
|
|
82
|
+
lightgreen: "#90ee90",
|
|
83
|
+
lightgrey: "#d3d3d3",
|
|
84
|
+
lightpink: "#ffb6c1",
|
|
85
|
+
lightsalmon: "#ffa07a",
|
|
86
|
+
lightseagreen: "#20b2aa",
|
|
87
|
+
lightskyblue: "#87cefa",
|
|
88
|
+
lightslategray: "#778899",
|
|
89
|
+
lightslategrey: "#778899",
|
|
90
|
+
lightsteelblue: "#b0c4de",
|
|
91
|
+
lightyellow: "#ffffe0",
|
|
92
|
+
lime: "#00ff00",
|
|
93
|
+
limegreen: "#32cd32",
|
|
94
|
+
linen: "#faf0e6",
|
|
95
|
+
magenta: "#ff00ff",
|
|
96
|
+
maroon: "#800000",
|
|
97
|
+
mediumaquamarine: "#66cdaa",
|
|
98
|
+
mediumblue: "#0000cd",
|
|
99
|
+
mediumorchid: "#ba55d3",
|
|
100
|
+
mediumpurple: "#9370db",
|
|
101
|
+
mediumseagreen: "#3cb371",
|
|
102
|
+
mediumslateblue: "#7b68ee",
|
|
103
|
+
mediumspringgreen: "#00fa9a",
|
|
104
|
+
mediumturquoise: "#48d1cc",
|
|
105
|
+
mediumvioletred: "#c71585",
|
|
106
|
+
midnightblue: "#191970",
|
|
107
|
+
mintcream: "#f5fffa",
|
|
108
|
+
mistyrose: "#ffe4e1",
|
|
109
|
+
moccasin: "#ffe4b5",
|
|
110
|
+
navajowhite: "#ffdead",
|
|
111
|
+
navy: "#000080",
|
|
112
|
+
oldlace: "#fdf5e6",
|
|
113
|
+
olive: "#808000",
|
|
114
|
+
olivedrab: "#6b8e23",
|
|
115
|
+
orange: "#ffa500",
|
|
116
|
+
orangered: "#ff4500",
|
|
117
|
+
orchid: "#da70d6",
|
|
118
|
+
palegoldenrod: "#eee8aa",
|
|
119
|
+
palegreen: "#98fb98",
|
|
120
|
+
paleturquoise: "#afeeee",
|
|
121
|
+
palevioletred: "#db7093",
|
|
122
|
+
papayawhip: "#ffefd5",
|
|
123
|
+
peachpuff: "#ffdab9",
|
|
124
|
+
peru: "#cd853f",
|
|
125
|
+
pink: "#ffc0cb",
|
|
126
|
+
plum: "#dda0dd",
|
|
127
|
+
powderblue: "#b0e0e6",
|
|
128
|
+
purple: "#800080",
|
|
129
|
+
rebeccapurple: "#663399",
|
|
130
|
+
red: "#ff0000",
|
|
131
|
+
rosybrown: "#bc8f8f",
|
|
132
|
+
royalblue: "#4169e1",
|
|
133
|
+
saddlebrown: "#8b4513",
|
|
134
|
+
salmon: "#fa8072",
|
|
135
|
+
sandybrown: "#f4a460",
|
|
136
|
+
seagreen: "#2e8b57",
|
|
137
|
+
seashell: "#fff5ee",
|
|
138
|
+
sienna: "#a0522d",
|
|
139
|
+
silver: "#c0c0c0",
|
|
140
|
+
skyblue: "#87ceeb",
|
|
141
|
+
slateblue: "#6a5acd",
|
|
142
|
+
slategray: "#708090",
|
|
143
|
+
slategrey: "#708090",
|
|
144
|
+
snow: "#fffafa",
|
|
145
|
+
springgreen: "#00ff7f",
|
|
146
|
+
steelblue: "#4682b4",
|
|
147
|
+
tan: "#d2b48c",
|
|
148
|
+
teal: "#008080",
|
|
149
|
+
thistle: "#d8bfd8",
|
|
150
|
+
tomato: "#ff6347",
|
|
151
|
+
turquoise: "#40e0d0",
|
|
152
|
+
violet: "#ee82ee",
|
|
153
|
+
wheat: "#f5deb3",
|
|
154
|
+
white: "#ffffff",
|
|
155
|
+
whitesmoke: "#f5f5f5",
|
|
156
|
+
yellow: "#ffff00",
|
|
157
|
+
yellowgreen: "#9acd32"
|
|
158
|
+
};
|
|
159
|
+
}));
|
|
160
|
+
//#endregion
|
|
161
|
+
Object.defineProperty(exports, "default", {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
get: function() {
|
|
164
|
+
return require_css_color_names();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=css-color-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-color-names.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/css-color-names.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.names = void 0;\n// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json\n/**\n * @hidden\n */\nexports.names = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n goldenrod: '#daa520',\n gold: '#ffd700',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavenderblush: '#fff0f5',\n lavender: '#e6e6fa',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n"],"x_google_ignoreList":[0],"mappings":";;;CACA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,QAAQ,KAAK;;;;CAKrB,QAAQ,QAAQ;EACZ,WAAW;EACX,cAAc;EACd,MAAM;EACN,YAAY;EACZ,OAAO;EACP,OAAO;EACP,QAAQ;EACR,OAAO;EACP,gBAAgB;EAChB,MAAM;EACN,YAAY;EACZ,OAAO;EACP,WAAW;EACX,WAAW;EACX,YAAY;EACZ,WAAW;EACX,OAAO;EACP,gBAAgB;EA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,UAAU;EACV,UAAU;EACV,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,WAAW;EACX,WAAW;EACX,WAAW;EACX,MAAM;EACN,aAAa;EACb,WAAW;EACX,KAAK;EACL,MAAM;EACN,SAAS;EACT,QAAQ;EACR,WAAW;EACX,QAAQ;EACR,OAAO;EACP,OAAO;EACP,YAAY;EACZ,QAAQ;EACR,aAAa;CACjB"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_util$1 = require("./util.js");
|
|
4
|
+
const require_conversion$1 = require("./conversion.js");
|
|
5
|
+
const require_css_color_names$1 = require("./css-color-names.js");
|
|
6
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/format-input.js
|
|
7
|
+
var require_format_input = /* @__PURE__ */ require_runtime.__commonJSMin(((exports) => {
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isValidCSSUnit = exports.stringInputToObject = exports.inputToRGB = void 0;
|
|
10
|
+
const conversion_js_1 = require_conversion$1.default;
|
|
11
|
+
const css_color_names_js_1 = require_css_color_names$1.default;
|
|
12
|
+
const util_js_1 = require_util$1.default;
|
|
13
|
+
/**
|
|
14
|
+
* Given a string or object, convert that input to RGB
|
|
15
|
+
*
|
|
16
|
+
* Possible string inputs:
|
|
17
|
+
* ```
|
|
18
|
+
* "red"
|
|
19
|
+
* "#f00" or "f00"
|
|
20
|
+
* "#ff0000" or "ff0000"
|
|
21
|
+
* "#ff000000" or "ff000000"
|
|
22
|
+
* "rgb 255 0 0" or "rgb (255, 0, 0)"
|
|
23
|
+
* "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
|
24
|
+
* "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
|
25
|
+
* "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
|
26
|
+
* "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
|
27
|
+
* "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
|
28
|
+
* "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
|
29
|
+
* "cmyk(0, 20, 0, 0)" or "cmyk 0 20 0 0"
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function inputToRGB(color) {
|
|
33
|
+
let rgb = {
|
|
34
|
+
r: 0,
|
|
35
|
+
g: 0,
|
|
36
|
+
b: 0
|
|
37
|
+
};
|
|
38
|
+
let a = 1;
|
|
39
|
+
let s = null;
|
|
40
|
+
let v = null;
|
|
41
|
+
let l = null;
|
|
42
|
+
let ok = false;
|
|
43
|
+
let format = false;
|
|
44
|
+
if (typeof color === "string") color = stringInputToObject(color);
|
|
45
|
+
if (typeof color === "object") {
|
|
46
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
47
|
+
rgb = (0, conversion_js_1.rgbToRgb)(color.r, color.g, color.b);
|
|
48
|
+
ok = true;
|
|
49
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
50
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
51
|
+
s = (0, util_js_1.convertToPercentage)(color.s);
|
|
52
|
+
v = (0, util_js_1.convertToPercentage)(color.v);
|
|
53
|
+
rgb = (0, conversion_js_1.hsvToRgb)(color.h, s, v);
|
|
54
|
+
ok = true;
|
|
55
|
+
format = "hsv";
|
|
56
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
57
|
+
s = (0, util_js_1.convertToPercentage)(color.s);
|
|
58
|
+
l = (0, util_js_1.convertToPercentage)(color.l);
|
|
59
|
+
rgb = (0, conversion_js_1.hslToRgb)(color.h, s, l);
|
|
60
|
+
ok = true;
|
|
61
|
+
format = "hsl";
|
|
62
|
+
} else if (isValidCSSUnit(color.c) && isValidCSSUnit(color.m) && isValidCSSUnit(color.y) && isValidCSSUnit(color.k)) {
|
|
63
|
+
rgb = (0, conversion_js_1.cmykToRgb)(color.c, color.m, color.y, color.k);
|
|
64
|
+
ok = true;
|
|
65
|
+
format = "cmyk";
|
|
66
|
+
}
|
|
67
|
+
if (Object.prototype.hasOwnProperty.call(color, "a")) a = color.a;
|
|
68
|
+
}
|
|
69
|
+
a = (0, util_js_1.boundAlpha)(a);
|
|
70
|
+
return {
|
|
71
|
+
ok,
|
|
72
|
+
format: color.format || format,
|
|
73
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
74
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
75
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
76
|
+
a
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
exports.inputToRGB = inputToRGB;
|
|
80
|
+
const matchers = {
|
|
81
|
+
CSS_UNIT: /* @__PURE__ */ new RegExp("(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)"),
|
|
82
|
+
rgb: /* @__PURE__ */ new RegExp("rgb[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
83
|
+
rgba: /* @__PURE__ */ new RegExp("rgba[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
84
|
+
hsl: /* @__PURE__ */ new RegExp("hsl[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
85
|
+
hsla: /* @__PURE__ */ new RegExp("hsla[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
86
|
+
hsv: /* @__PURE__ */ new RegExp("hsv[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
87
|
+
hsva: /* @__PURE__ */ new RegExp("hsva[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
88
|
+
cmyk: /* @__PURE__ */ new RegExp("cmyk[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
89
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
90
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
91
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
92
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Permissive string parsing. Take in a number of formats, and output an object
|
|
96
|
+
* based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` or `{c, m, y, k}` or `{c, m, y, k, a}`
|
|
97
|
+
*/
|
|
98
|
+
function stringInputToObject(color) {
|
|
99
|
+
color = color.trim().toLowerCase();
|
|
100
|
+
if (color.length === 0) return false;
|
|
101
|
+
let named = false;
|
|
102
|
+
if (css_color_names_js_1.names[color]) {
|
|
103
|
+
color = css_color_names_js_1.names[color];
|
|
104
|
+
named = true;
|
|
105
|
+
} else if (color === "transparent") return {
|
|
106
|
+
r: 0,
|
|
107
|
+
g: 0,
|
|
108
|
+
b: 0,
|
|
109
|
+
a: 0,
|
|
110
|
+
format: "name"
|
|
111
|
+
};
|
|
112
|
+
let match = matchers.rgb.exec(color);
|
|
113
|
+
if (match) return {
|
|
114
|
+
r: match[1],
|
|
115
|
+
g: match[2],
|
|
116
|
+
b: match[3]
|
|
117
|
+
};
|
|
118
|
+
match = matchers.rgba.exec(color);
|
|
119
|
+
if (match) return {
|
|
120
|
+
r: match[1],
|
|
121
|
+
g: match[2],
|
|
122
|
+
b: match[3],
|
|
123
|
+
a: match[4]
|
|
124
|
+
};
|
|
125
|
+
match = matchers.hsl.exec(color);
|
|
126
|
+
if (match) return {
|
|
127
|
+
h: match[1],
|
|
128
|
+
s: match[2],
|
|
129
|
+
l: match[3]
|
|
130
|
+
};
|
|
131
|
+
match = matchers.hsla.exec(color);
|
|
132
|
+
if (match) return {
|
|
133
|
+
h: match[1],
|
|
134
|
+
s: match[2],
|
|
135
|
+
l: match[3],
|
|
136
|
+
a: match[4]
|
|
137
|
+
};
|
|
138
|
+
match = matchers.hsv.exec(color);
|
|
139
|
+
if (match) return {
|
|
140
|
+
h: match[1],
|
|
141
|
+
s: match[2],
|
|
142
|
+
v: match[3]
|
|
143
|
+
};
|
|
144
|
+
match = matchers.hsva.exec(color);
|
|
145
|
+
if (match) return {
|
|
146
|
+
h: match[1],
|
|
147
|
+
s: match[2],
|
|
148
|
+
v: match[3],
|
|
149
|
+
a: match[4]
|
|
150
|
+
};
|
|
151
|
+
match = matchers.cmyk.exec(color);
|
|
152
|
+
if (match) return {
|
|
153
|
+
c: match[1],
|
|
154
|
+
m: match[2],
|
|
155
|
+
y: match[3],
|
|
156
|
+
k: match[4]
|
|
157
|
+
};
|
|
158
|
+
match = matchers.hex8.exec(color);
|
|
159
|
+
if (match) return {
|
|
160
|
+
r: (0, conversion_js_1.parseIntFromHex)(match[1]),
|
|
161
|
+
g: (0, conversion_js_1.parseIntFromHex)(match[2]),
|
|
162
|
+
b: (0, conversion_js_1.parseIntFromHex)(match[3]),
|
|
163
|
+
a: (0, conversion_js_1.convertHexToDecimal)(match[4]),
|
|
164
|
+
format: named ? "name" : "hex8"
|
|
165
|
+
};
|
|
166
|
+
match = matchers.hex6.exec(color);
|
|
167
|
+
if (match) return {
|
|
168
|
+
r: (0, conversion_js_1.parseIntFromHex)(match[1]),
|
|
169
|
+
g: (0, conversion_js_1.parseIntFromHex)(match[2]),
|
|
170
|
+
b: (0, conversion_js_1.parseIntFromHex)(match[3]),
|
|
171
|
+
format: named ? "name" : "hex"
|
|
172
|
+
};
|
|
173
|
+
match = matchers.hex4.exec(color);
|
|
174
|
+
if (match) return {
|
|
175
|
+
r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),
|
|
176
|
+
g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),
|
|
177
|
+
b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),
|
|
178
|
+
a: (0, conversion_js_1.convertHexToDecimal)(match[4] + match[4]),
|
|
179
|
+
format: named ? "name" : "hex8"
|
|
180
|
+
};
|
|
181
|
+
match = matchers.hex3.exec(color);
|
|
182
|
+
if (match) return {
|
|
183
|
+
r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),
|
|
184
|
+
g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),
|
|
185
|
+
b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),
|
|
186
|
+
format: named ? "name" : "hex"
|
|
187
|
+
};
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
exports.stringInputToObject = stringInputToObject;
|
|
191
|
+
/**
|
|
192
|
+
* Check to see if it looks like a CSS unit
|
|
193
|
+
* (see `matchers` above for definition).
|
|
194
|
+
*/
|
|
195
|
+
function isValidCSSUnit(color) {
|
|
196
|
+
if (typeof color === "number") return !Number.isNaN(color);
|
|
197
|
+
return matchers.CSS_UNIT.test(color);
|
|
198
|
+
}
|
|
199
|
+
exports.isValidCSSUnit = isValidCSSUnit;
|
|
200
|
+
}));
|
|
201
|
+
//#endregion
|
|
202
|
+
Object.defineProperty(exports, "default", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function() {
|
|
205
|
+
return require_format_input();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
//# sourceMappingURL=format-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-input.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/format-input.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isValidCSSUnit = exports.stringInputToObject = exports.inputToRGB = void 0;\nconst conversion_js_1 = require(\"./conversion.js\");\nconst css_color_names_js_1 = require(\"./css-color-names.js\");\nconst util_js_1 = require(\"./util.js\");\n/**\n * Given a string or object, convert that input to RGB\n *\n * Possible string inputs:\n * ```\n * \"red\"\n * \"#f00\" or \"f00\"\n * \"#ff0000\" or \"ff0000\"\n * \"#ff000000\" or \"ff000000\"\n * \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n * \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n * \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n * \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n * \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n * \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n * \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n * \"cmyk(0, 20, 0, 0)\" or \"cmyk 0 20 0 0\"\n * ```\n */\nfunction inputToRGB(color) {\n let rgb = { r: 0, g: 0, b: 0 };\n let a = 1;\n let s = null;\n let v = null;\n let l = null;\n let ok = false;\n let format = false;\n if (typeof color === 'string') {\n color = stringInputToObject(color);\n }\n if (typeof color === 'object') {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = (0, conversion_js_1.rgbToRgb)(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = (0, util_js_1.convertToPercentage)(color.s);\n v = (0, util_js_1.convertToPercentage)(color.v);\n rgb = (0, conversion_js_1.hsvToRgb)(color.h, s, v);\n ok = true;\n format = 'hsv';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = (0, util_js_1.convertToPercentage)(color.s);\n l = (0, util_js_1.convertToPercentage)(color.l);\n rgb = (0, conversion_js_1.hslToRgb)(color.h, s, l);\n ok = true;\n format = 'hsl';\n }\n else if (isValidCSSUnit(color.c) &&\n isValidCSSUnit(color.m) &&\n isValidCSSUnit(color.y) &&\n isValidCSSUnit(color.k)) {\n rgb = (0, conversion_js_1.cmykToRgb)(color.c, color.m, color.y, color.k);\n ok = true;\n format = 'cmyk';\n }\n if (Object.prototype.hasOwnProperty.call(color, 'a')) {\n a = color.a;\n }\n }\n a = (0, util_js_1.boundAlpha)(a);\n return {\n ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a,\n };\n}\nexports.inputToRGB = inputToRGB;\n// <http://www.w3.org/TR/css3-values/#integers>\nconst CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n// <http://www.w3.org/TR/css3-values/#number-value>\nconst CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\nconst CSS_UNIT = '(?:' + CSS_NUMBER + ')|(?:' + CSS_INTEGER + ')';\n// Actual matching.\n// Parentheses and commas are optional, but not required.\n// Whitespace can take the place of commas or opening paren\n// eslint-disable-next-line prettier/prettier\nconst PERMISSIVE_MATCH3 = '[\\\\s|\\\\(]+(' + CSS_UNIT + ')[,|\\\\s]+(' + CSS_UNIT + ')[,|\\\\s]+(' + CSS_UNIT + ')\\\\s*\\\\)?';\nconst PERMISSIVE_MATCH4 = \n// eslint-disable-next-line prettier/prettier\n'[\\\\s|\\\\(]+(' + CSS_UNIT + ')[,|\\\\s]+(' + CSS_UNIT + ')[,|\\\\s]+(' + CSS_UNIT + ')[,|\\\\s]+(' + CSS_UNIT + ')\\\\s*\\\\)?';\nconst matchers = {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),\n rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),\n hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),\n hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),\n hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),\n hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),\n cmyk: new RegExp('cmyk' + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n};\n/**\n * Permissive string parsing. Take in a number of formats, and output an object\n * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` or `{c, m, y, k}` or `{c, m, y, k, a}`\n */\nfunction stringInputToObject(color) {\n color = color.trim().toLowerCase();\n if (color.length === 0) {\n return false;\n }\n let named = false;\n if (css_color_names_js_1.names[color]) {\n color = css_color_names_js_1.names[color];\n named = true;\n }\n else if (color === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\n }\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n let match = matchers.rgb.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n match = matchers.rgba.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n match = matchers.hsl.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n match = matchers.hsla.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n match = matchers.hsv.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n match = matchers.hsva.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n match = matchers.cmyk.exec(color);\n if (match) {\n return {\n c: match[1],\n m: match[2],\n y: match[3],\n k: match[4],\n };\n }\n match = matchers.hex8.exec(color);\n if (match) {\n return {\n r: (0, conversion_js_1.parseIntFromHex)(match[1]),\n g: (0, conversion_js_1.parseIntFromHex)(match[2]),\n b: (0, conversion_js_1.parseIntFromHex)(match[3]),\n a: (0, conversion_js_1.convertHexToDecimal)(match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex6.exec(color);\n if (match) {\n return {\n r: (0, conversion_js_1.parseIntFromHex)(match[1]),\n g: (0, conversion_js_1.parseIntFromHex)(match[2]),\n b: (0, conversion_js_1.parseIntFromHex)(match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n match = matchers.hex4.exec(color);\n if (match) {\n return {\n r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),\n g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),\n b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),\n a: (0, conversion_js_1.convertHexToDecimal)(match[4] + match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex3.exec(color);\n if (match) {\n return {\n r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),\n g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),\n b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n return false;\n}\nexports.stringInputToObject = stringInputToObject;\n/**\n * Check to see if it looks like a CSS unit\n * (see `matchers` above for definition).\n */\nfunction isValidCSSUnit(color) {\n if (typeof color === 'number') {\n return !Number.isNaN(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AAS,KAAK,KAAK;CACvC;CACA,QAAQ,iBAAiB"}
|
package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.js");
|
|
3
|
+
const require_util$1 = require("./util.js");
|
|
4
|
+
const require_index = require("./index.js");
|
|
5
|
+
//#region ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js
|
|
6
|
+
var require_from_ratio = /* @__PURE__ */ require_runtime.__commonJSMin(((exports) => {
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.legacyRandom = exports.fromRatio = void 0;
|
|
9
|
+
const index_js_1 = require_index.default;
|
|
10
|
+
const util_js_1 = require_util$1.default;
|
|
11
|
+
/**
|
|
12
|
+
* If input is an object, force 1 into "1.0" to handle ratios properly
|
|
13
|
+
* String input requires "1.0" as input, so 1 will be treated as 1
|
|
14
|
+
*/
|
|
15
|
+
function fromRatio(ratio, opts) {
|
|
16
|
+
const newColor = {
|
|
17
|
+
r: (0, util_js_1.convertToPercentage)(ratio.r),
|
|
18
|
+
g: (0, util_js_1.convertToPercentage)(ratio.g),
|
|
19
|
+
b: (0, util_js_1.convertToPercentage)(ratio.b)
|
|
20
|
+
};
|
|
21
|
+
if (ratio.a !== void 0) newColor.a = Number(ratio.a);
|
|
22
|
+
return new index_js_1.TinyColor(newColor, opts);
|
|
23
|
+
}
|
|
24
|
+
exports.fromRatio = fromRatio;
|
|
25
|
+
/** old random function */
|
|
26
|
+
function legacyRandom() {
|
|
27
|
+
return new index_js_1.TinyColor({
|
|
28
|
+
r: Math.random(),
|
|
29
|
+
g: Math.random(),
|
|
30
|
+
b: Math.random()
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.legacyRandom = legacyRandom;
|
|
34
|
+
}));
|
|
35
|
+
//#endregion
|
|
36
|
+
Object.defineProperty(exports, "default", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function() {
|
|
39
|
+
return require_from_ratio();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=from-ratio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-ratio.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@ctrl+tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.legacyRandom = exports.fromRatio = void 0;\nconst index_js_1 = require(\"./index.js\");\nconst util_js_1 = require(\"./util.js\");\n/**\n * If input is an object, force 1 into \"1.0\" to handle ratios properly\n * String input requires \"1.0\" as input, so 1 will be treated as 1\n */\nfunction fromRatio(ratio, opts) {\n const newColor = {\n r: (0, util_js_1.convertToPercentage)(ratio.r),\n g: (0, util_js_1.convertToPercentage)(ratio.g),\n b: (0, util_js_1.convertToPercentage)(ratio.b),\n };\n if (ratio.a !== undefined) {\n newColor.a = Number(ratio.a);\n }\n return new index_js_1.TinyColor(newColor, opts);\n}\nexports.fromRatio = fromRatio;\n/** old random function */\nfunction legacyRandom() {\n return new index_js_1.TinyColor({\n r: Math.random(),\n g: Math.random(),\n b: Math.random(),\n });\n}\nexports.legacyRandom = legacyRandom;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CACA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAK,CAAC;CAC5D,QAAQ,eAAe,QAAQ,YAAY,KAAK;CAChD,MAAM,aAAA,cAAA;CACN,MAAM,YAAA,eAAA;;;;;CAKN,SAAS,UAAU,OAAO,MAAM;EAC5B,MAAM,WAAW;GACb,IAAI,GAAG,UAAU,oBAAA,CAAqB,MAAM,CAAC;GAC7C,IAAI,GAAG,UAAU,oBAAA,CAAqB,MAAM,CAAC;GAC7C,IAAI,GAAG,UAAU,oBAAA,CAAqB,MAAM,CAAC;EACjD;EACA,IAAI,MAAM,MAAM,KAAA,GACZ,SAAS,IAAI,OAAO,MAAM,CAAC;EAE/B,OAAO,IAAI,WAAW,UAAU,UAAU,IAAI;CAClD;CACA,QAAQ,YAAY;;CAEpB,SAAS,eAAe;EACpB,OAAO,IAAI,WAAW,UAAU;GAC5B,GAAG,KAAK,OAAO;GACf,GAAG,KAAK,OAAO;GACf,GAAG,KAAK,OAAO;EACnB,CAAC;CACL;CACA,QAAQ,eAAe"}
|