├── .eslintrc.json ├── .gitignore ├── .prettierignore ├── .prettierrc ├── LICENSE ├── README.md ├── dist ├── index.cjs ├── index.cjs.map ├── index.modern.js ├── index.modern.js.map ├── index.module.js ├── index.module.js.map ├── index.umd.js ├── index.umd.js.map └── types │ └── index.d.ts ├── index.ts ├── jest.config.js ├── package-lock.json ├── package.json ├── tests ├── __mocks__ │ └── mockData.ts └── index.test.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true, 5 | "node": true 6 | }, 7 | "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], 8 | "overrides": [], 9 | "parser": "@typescript-eslint/parser", 10 | "parserOptions": { 11 | "ecmaVersion": "latest", 12 | "sourceType": "module" 13 | }, 14 | "plugins": ["@typescript-eslint", "prettier"], 15 | "rules": { 16 | "prettier/prettier": 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | /coverage -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | README.md 2 | dist 3 | tsconfig.json -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5", 4 | "arrowParens": "always", 5 | "bracketSameLine": false, 6 | "printWidth": 120, 7 | "tabWidth": 2, 8 | "semi": true 9 | } 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Brandon McConnell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Lerp Colors for Tailwind CSS

2 | 3 |
“Lerp” = (L)inear Int(erp)olation

4 | 5 |
6 | 7 | [![minified size](https://img.shields.io/bundlephobia/min/tailwind-lerp-colors)](https://bundlephobia.com/package/tailwind-lerp-colors) 8 | [![license](https://img.shields.io/github/license/brandonmcconnell/tailwind-lerp-colors?label=license)](https://github.com/brandonmcconnell/tailwind-lerp-colors/blob/main/LICENSE) 9 | [![version](https://img.shields.io/npm/v/tailwind-lerp-colors)](https://www.npmjs.com/package/tailwind-lerp-colors) 10 | [![twitter](https://img.shields.io/twitter/follow/branmcconnell)](https://twitter.com/branmcconnell) 11 | 12 |
13 | 14 | **Tailwind Lerp Colors** programmatically interpolates between any default and extended colors in a Tailwind config for additional color stops (e.g. `red-425`, `gray-950`). 15 | 16 |
17 | 18 |
19 |

Table of Contents

20 | 34 |
35 | 36 |
37 | 38 | ## Installation 39 | Install the function from npm: 40 | ```bash 41 | npm i -D tailwind-lerp-colors 42 | ``` 43 | 44 | Then add the function to your `tailwind.config.js` file. It's recommended to use `tailwind-lerp-colors` in `theme.colors` and NOT `theme.extend.colors` as the function will only interpolate colors passed into its object, and using `theme.extend.colors` generally implies you're relying on leaving `theme.colors` as-is to keep the standard Tailwind colors. That route, the standard colors would not be interpolated along with your custom colors. 45 | 46 | As a convenience, there is a `includeBase` property which can be passed into the `options` (though it's enabled by default) which automate importing Tailwind's base colors, so you do not need to pass them in manually. 47 | As a convenience, there is a `includeBase` property which can be passed into the `options` (though it's enabled by default) which automatically imports Tailwind's base colors so you don't need to pass them in manually. 48 | 49 | Also, if you rely on some of Tailwind's legacy color names (`lightBlue`, `warmGray`, `trueGray`, `coolGray`, `blueGray`), you can enable the `includeLegacy` property by setting it to `true` to include those legacy colors as well, though it's recommended by the Tailwind team to alias those legacy color names directly in your Tailwind config and not rely on Tailwind's `require('tailwindcss/colors')` to add those for you, as that will produce a warning. More info on that can be found on the official Tailwind CSS website [here](https://tailwindcss.com/docs/upgrade-guide#renamed-gray-scales). 50 | 51 | If you want to interpolate a group of named colors, use the `lerpColors` (plural) function like this: 52 | ```js 53 | // tailwind.config.js 54 | const { lerpColors } = require('tailwind-lerp-colors'); 55 | 56 | module.exports = { 57 | theme: { 58 | colors: lerpColors({ 59 | coral: coralShades, 60 | }, { 61 | // function options (all optional) 62 | includeBase: true, 63 | includeLegacy: false, 64 | lerpEnds: true, 65 | interval: 25, 66 | mode: 'lrgb', 67 | }) 68 | }, 69 | } 70 | ``` 71 | 72 | If you want to interpolate a single color, use the `lerpColor` (singular) function like this: 73 | ```js 74 | // tailwind.config.js 75 | const { lerpColor } = require('tailwind-lerp-colors'); 76 | 77 | module.exports = { 78 | theme: { 79 | colors: { 80 | coral: lerpColor(coralShades, { 81 | lerpEnds: true, 82 | interval: 25, 83 | mode: 'lrgb', 84 | }), 85 | } 86 | }, 87 | } 88 | ``` 89 | 90 | ℹ️ One important distinction here between the options for `lerpColors` and `lerpColor` is that `includeBase` and `includeLegacy` are not available for `lerpColor` as it's only interpolating a single color, so there's no need to include the base colors. 91 | 92 | ## Usage 93 | `tailwind-lerp-colors` works without using any options, so if you're good with the default options (listed below in the "Advanced usage" example), this should work for you: 94 | 95 | ### Simple usage: 96 | ```js 97 | // tailwind.config.js 98 | theme: { 99 | colors: lerpColors({ 100 | // your colors 101 | }) 102 | } 103 | ``` 104 | 105 | Alternatively, if you want more flexibility, you can invoke the `tailwind-lerp-colors` function with an options object. 106 | 107 | ### Advanced usage: 108 | ```js 109 | // tailwind.config.js 110 | theme: { 111 | colors: lerpColors({ 112 | // your colors 113 | }, { 114 | // function options (all optional) 115 | includeBase: true, 116 | includeLegacy: false, 117 | lerpEnds: true, 118 | interval: 25, 119 | mode: 'lrgb', 120 | }) 121 | } 122 | ``` 123 | 124 | The values listed above are all the options currently supported and their default values. Using the above would render the exact same result as the simple usage listed prior. 125 | 126 | Every option in the options object is entirely optional and falls back to its respective default option when omitted. 127 | 128 | #### Options explained: 129 | * `includeBase` (`boolean`) determines whether or not to include Tailwind's base colors in the interpolation and final colors. In Tailwind v3.x, all Tailwind base colors are enabled by default for use with the JIT compiler. 130 | 131 | This setting follows the same methodology and includes all Tailwind base colors in the interpolation of your colors, even if they are not explicitly listed in your Tailwind config. When this option is enabled, the base colors are included at a lower priority, so any colors of the same name you list in your Tailwind config will still override the base colors as they normally would. 132 | 133 | If this setting is disabled, the function will only interpolate colors explicitly listed in your Tailwind config. 134 | 135 | * `includeLegacy` (`boolean`) will include Tailwind's legacy color names (`lightBlue`, `warmGray`, `trueGray`, `coolGray`, `blueGray`) in the final colors output by `tailwind-lerp-colors`. As mentioned above, it's recommended by the Tailwind team to alias those legacy color names directly in your Tailwind config and not rely on Tailwind's `require('tailwindcss/colors')` to add those for you, as that will produce a warning. More info on that can be found on the official Tailwind CSS website [here](https://tailwindcss.com/docs/upgrade-guide#renamed-gray-scales). 136 | 137 | ** *`includeBase` must be set to true in order for `includeLegacy` to work* 138 | 139 | * `lerpEnds` (`boolean`) will include interpolation past the bounds of the colors included in the provided palette. For example, assuming a color `brown` is included in Tailwind config colors, where `brown-50` is the lightest shade and `brown-900` is the darkest shade, the function—when enabled—would interpolate between white (`#fff`) and `brown-50` and between black (`#000`) and `brown-900` to expose lighter and darker shades of every color than those included in the palette. 140 | 141 | * `interval` (`number`, positive integer) sets the interval at which to interpolate colors. For example, with the default value of `25`, between `red-100` and `red-200`, it would interpolate the additional values `red-125`, `red-150`, and `red-175`. To include only the “halfway” values and not “quarter” values, you could pass an `interval` value of `50` which would only interpolate `red-150` between `red-100` and `red-200`. To interpolate every single value between each shade, you can pass a value of `1`, which would expose `red-101`, `red-102`, `red-103`, …, `red-899` per the default colors (including `red-0` and `red-1000` if `lerpEnds` is enabled). 142 | 143 | It's important to note that each color's default intervals must be evenly divisible by the interval passed in this function, so it's recommended to use a naming convention similar to the one included in Tailwind by default: 144 | ``` 145 | 50, 100, 200, 300, 400, 500, 600, 700, 800, 900 146 | ``` 147 | 148 | If one of your colors uses keys like the aqua example below (`0-9` rather than `50-900`), you'll need to use an interval that divides evenly into those numeric keys, such as `0.25`. 149 | ```js 150 | aqua: { 151 | 0: '#eefdf8', 152 | 1: '#cffbeb', 153 | 2: '#a0f5da', 154 | 3: '#66e9c6', 155 | 4: '#31d4ad', 156 | 5: '#12b995', 157 | 6: '#0a9579', 158 | 7: '#0b7763', 159 | 8: '#0d5f50', 160 | 9: '#0e4e43', 161 | } 162 | ``` 163 | 164 | While using an interval like `25` would not be compatible with a color like the one listed above, rest assured this conflict will neither break the function or your Tailwind config nor even exclude the color. Any color that is found to be incompatible with the `interval` value, whether because of a divisibility issue like in the aqua example above or because the color is a simple string (e.g. `brand-primary: '#c000ff'`), these colors will simply skip the interpolation step and be re-included into the new colors as-is. 165 | 166 | * `mode` (`string`, must be value from list, see below) allows you to interpolate using the color mode of your choice for better color interpolation. This helps to avoid gray dead zones (more info on that [here](https://css-tricks.com/the-gray-dead-zone-of-gradients/)). This is especially useful when interpolating between colors of different hues. 167 | 168 | What this means at a larger scale is you can create beautiful palettes of colors using as few as two colors and letting `tailwind-lerp-colors` do the heavy lifting, interpolating between them. 169 | 170 | The accepted values for mode are: 171 | * `lrgb` (default) 172 | * `rgb` 173 | * `lab` 174 | * `lch` 175 | * `hcl` 176 | * `num` 177 | * `hcg` 178 | * `oklch` 179 | * `hsi` 180 | * `hsl` 181 | * `hsv` 182 | * `oklab` 183 | 184 | ## Roadmap 185 | I have a few improvements planned already, and I am always open to feature requests and bug reports. 186 | 187 | Here are some of the features I have planned: 188 | 189 | * a `function` option that allows users to more effectively control the rate at which the function interpolates between different colors, which would also allow for better luminosity matching with the base color palettes included in Tailwind 190 | 191 | * filtering options, so users can define which colors they do or don't want to interpolate on 192 | 193 | * itemized options, so that options can be uniquely set per color 194 | 195 | ## Contributing 196 | Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. 197 | 198 | Please run tests where appropriate to help streamline the review and deployment process. 199 | 200 | ## Support 201 | 202 | While you can always support me via [Buy Me a Coffee](https://buymeacoffee.com/brandonmcconnell), the best way to support me and this development is actually to contribute. Every bit of feedback helps me to develop tools the way you as users want them. Thanks! 203 | 204 | Also, while I developed this function, much of the ✨magic✨ working behind the scenes runs on Chroma.js, built by [Gregor Aisch](https://github.com/gka) and contributed to by many! Chroma.js is an incredible tool that powers much of the crazy color interactions you see on the web, so definitely pay the [Chroma.js repo](https://github.com/gka/chroma.js) a visit. 205 | 206 | ## License 207 | [MIT](https://github.com/brandonmcconnell/tailwind-lerp-colors/blob/main/LICENSE/) 208 | 209 | ## Recommendations 210 | 211 | If you liked this, you might also like my other Tailwind CSS plugins: 212 | * [tailwindcss-multi](https://github.com/brandonmcconnell/tailwindcss-multi): Group utilities together by variant 213 | * [tailwindcss-signals](https://github.com/brandonmcconnell/tailwindcss-signals): Apply styles based on parent or ancestor state, a state-driven alterative to groups 214 | * [tailwindcss-members](https://github.com/brandonmcconnell/tailwindcss-members): Apply styles based on child or descendant state, the inverse of groups 215 | * [tailwindcss-mixins](https://github.com/brandonmcconnell/tailwindcss-mixins): Construct reusable & aliased sets of utilities inline 216 | * [tailwindcss-default-shades](https://github.com/brandonmcconnell/tailwindcss-default-shades): Default shades for simpler color utility classes 217 | * [tailwindcss-selector-patterns](https://github.com/brandonmcconnell/tailwindcss-selector-patterns): Dynamic CSS selector patterns 218 | * [tailwindcss-js](https://github.com/brandonmcconnell/tailwindcss-js): Effortless build-time JS script injection 219 | * [tailwindcss-directional-shadows](https://github.com/brandonmcconnell/tailwindcss-directional-shadows): Supercharge your shadow utilities with added directional support (includes directional `shadow-border` utilities too ✨) 220 | -------------------------------------------------------------------------------- /dist/index.cjs: -------------------------------------------------------------------------------- 1 | function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/e(require("chroma-js"));function f(){return f=Object.assign?Object.assign.bind():function(e){for(var r=1;re.length)&&(r=e.length);for(var f=0,n=new Array(r);f=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(e){var r={exports:{}};return e(r,r.exports),r.exports}var o=String,c=function(){return{isColorSupported:!1,reset:o,bold:o,dim:o,italic:o,underline:o,inverse:o,hidden:o,strikethrough:o,black:o,red:o,green:o,yellow:o,blue:o,magenta:o,cyan:o,white:o,gray:o,bgBlack:o,bgRed:o,bgGreen:o,bgYellow:o,bgBlue:o,bgMagenta:o,bgCyan:o,bgWhite:o}},l=c();l.createColors=c;var i=l,d=t(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),function(e,r){for(var f in r)Object.defineProperty(e,f,{enumerable:!0,get:r[f]})}(r,{dim:function(){return o},default:function(){return c}});const f=/*#__PURE__*/n(i);function n(e){return e&&e.__esModule?e:{default:e}}let a=new Set;function t(e,r,f){"undefined"!=typeof process&&process.env.JEST_WORKER_ID||f&&a.has(f)||(f&&a.add(f),console.warn(""),r.forEach(r=>console.warn(e,"-",r)))}function o(e){return f.default.dim(e)}const c={info(e,r){t(f.default.bold(f.default.cyan("info")),...Array.isArray(e)?[e]:[r,e])},warn(e,r){t(f.default.bold(f.default.yellow("warn")),...Array.isArray(e)?[e]:[r,e])},risk(e,r){t(f.default.bold(f.default.magenta("risk")),...Array.isArray(e)?[e]:[r,e])}}}),u=t(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return t}});const f=/*#__PURE__*/n(d);function n(e){return e&&e.__esModule?e:{default:e}}function a({version:e,from:r,to:n}){f.default.warn(`${r}-color-renamed`,[`As of Tailwind CSS ${e}, \`${r}\` has been renamed to \`${n}\`.`,"Update your configuration file to silence this warning."])}const t={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}),b=(u.__esModule?u:{default:u}).default;function s(e){return Object.keys(e)}function y(e){return Object.entries(e)}var p=["rgb","lab","lch","lrgb","hcl","num","hcg","oklch","hsi","hsl","hsv","oklab"],v={lerpEnds:!0,interval:25,mode:"lrgb"},g=f({includeBase:!0,includeLegacy:!1},v),m=function(e,r,f){return e&&Object.prototype.hasOwnProperty.call(e,r)&&!f(e[r])},h=function(e){throw new Error(e)},w=function(e){return!(null==e||"object"!=typeof e||Array.isArray(e)||"[object Object]"!==e.toString()||!s(e).some(function(e){return!isNaN(+e)&&+e>=0&&+e<=1e3}))},j=function(e,n){var a;void 0===n&&(n={}),m(n,"lerpEnds",function(e){return"boolean"==typeof e})&&h("tailwind-lerp-colors option `lerpEnds` must be a boolean."),m(n,"interval",function(e){return Number.isInteger(e)&&"number"==typeof e&&e>0})&&h("tailwind-lerp-colors option `interval` must be a positive integer greater than 0."),m(n,"mode",function(e){return"string"==typeof e&&p.includes(e)})&&h("tailwind-lerp-colors option `mode` must be one of the following values: "+p.join(", ")+"."),w(e)||h("tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: "+JSON.stringify(e,null,2));var t,o,c=f({},v,null!=(a=n)?a:{}),l=c.lerpEnds,i=c.interval,d=c.mode,u=function(e,r){return e[0]-r[0]},b={},s=y(e).flatMap(function(e){var r=e[0],f=e[1],n=+r;return isNaN(n)?(b[r]=f,[]):[[n,f]]}).sort(u);l&&(0!==(null==(t=s[0])?void 0:t[0])&&s.unshift([0,"#ffffff"]),1e3!==(null==(o=s.slice(-1)[0])?void 0:o[0])&&s.push([1e3,"#000000"]));for(var g=[].concat(s),j=function(){var e,f,n=null!=(e=s[O])?e:[],a=n[0],t=n[1],o=null!=(f=s[O+1])?f:[],c=o[0],l=o[1];if(!(a&&t&&c&&l))return 0;var u,b=(c-a)/i-1;if(b<=0||!Number.isInteger(b))return 0;for(var y=r.default.scale([t,l]).mode(d),p=1;p<=b;p++)g.push([a+i*p,(u=p/(b+1),y(u).hex())])},O=0;Oconsole.warn(type, \"-\", message));\n}\nfunction dim(input) {\n return _picocolors.default.dim(input);\n}\nconst _default = {\n info (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.cyan(\"info\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n warn (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.yellow(\"warn\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n risk (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.magenta(\"risk\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _log = /*#__PURE__*/ _interop_require_default(require(\"../util/log\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction warn({ version , from , to }) {\n _log.default.warn(`${from}-color-renamed`, [\n `As of Tailwind CSS ${version}, \\`${from}\\` has been renamed to \\`${to}\\`.`,\n \"Update your configuration file to silence this warning.\"\n ]);\n}\nconst _default = {\n inherit: \"inherit\",\n current: \"currentColor\",\n transparent: \"transparent\",\n black: \"#000\",\n white: \"#fff\",\n slate: {\n 50: \"#f8fafc\",\n 100: \"#f1f5f9\",\n 200: \"#e2e8f0\",\n 300: \"#cbd5e1\",\n 400: \"#94a3b8\",\n 500: \"#64748b\",\n 600: \"#475569\",\n 700: \"#334155\",\n 800: \"#1e293b\",\n 900: \"#0f172a\",\n 950: \"#020617\"\n },\n gray: {\n 50: \"#f9fafb\",\n 100: \"#f3f4f6\",\n 200: \"#e5e7eb\",\n 300: \"#d1d5db\",\n 400: \"#9ca3af\",\n 500: \"#6b7280\",\n 600: \"#4b5563\",\n 700: \"#374151\",\n 800: \"#1f2937\",\n 900: \"#111827\",\n 950: \"#030712\"\n },\n zinc: {\n 50: \"#fafafa\",\n 100: \"#f4f4f5\",\n 200: \"#e4e4e7\",\n 300: \"#d4d4d8\",\n 400: \"#a1a1aa\",\n 500: \"#71717a\",\n 600: \"#52525b\",\n 700: \"#3f3f46\",\n 800: \"#27272a\",\n 900: \"#18181b\",\n 950: \"#09090b\"\n },\n neutral: {\n 50: \"#fafafa\",\n 100: \"#f5f5f5\",\n 200: \"#e5e5e5\",\n 300: \"#d4d4d4\",\n 400: \"#a3a3a3\",\n 500: \"#737373\",\n 600: \"#525252\",\n 700: \"#404040\",\n 800: \"#262626\",\n 900: \"#171717\",\n 950: \"#0a0a0a\"\n },\n stone: {\n 50: \"#fafaf9\",\n 100: \"#f5f5f4\",\n 200: \"#e7e5e4\",\n 300: \"#d6d3d1\",\n 400: \"#a8a29e\",\n 500: \"#78716c\",\n 600: \"#57534e\",\n 700: \"#44403c\",\n 800: \"#292524\",\n 900: \"#1c1917\",\n 950: \"#0c0a09\"\n },\n red: {\n 50: \"#fef2f2\",\n 100: \"#fee2e2\",\n 200: \"#fecaca\",\n 300: \"#fca5a5\",\n 400: \"#f87171\",\n 500: \"#ef4444\",\n 600: \"#dc2626\",\n 700: \"#b91c1c\",\n 800: \"#991b1b\",\n 900: \"#7f1d1d\",\n 950: \"#450a0a\"\n },\n orange: {\n 50: \"#fff7ed\",\n 100: \"#ffedd5\",\n 200: \"#fed7aa\",\n 300: \"#fdba74\",\n 400: \"#fb923c\",\n 500: \"#f97316\",\n 600: \"#ea580c\",\n 700: \"#c2410c\",\n 800: \"#9a3412\",\n 900: \"#7c2d12\",\n 950: \"#431407\"\n },\n amber: {\n 50: \"#fffbeb\",\n 100: \"#fef3c7\",\n 200: \"#fde68a\",\n 300: \"#fcd34d\",\n 400: \"#fbbf24\",\n 500: \"#f59e0b\",\n 600: \"#d97706\",\n 700: \"#b45309\",\n 800: \"#92400e\",\n 900: \"#78350f\",\n 950: \"#451a03\"\n },\n yellow: {\n 50: \"#fefce8\",\n 100: \"#fef9c3\",\n 200: \"#fef08a\",\n 300: \"#fde047\",\n 400: \"#facc15\",\n 500: \"#eab308\",\n 600: \"#ca8a04\",\n 700: \"#a16207\",\n 800: \"#854d0e\",\n 900: \"#713f12\",\n 950: \"#422006\"\n },\n lime: {\n 50: \"#f7fee7\",\n 100: \"#ecfccb\",\n 200: \"#d9f99d\",\n 300: \"#bef264\",\n 400: \"#a3e635\",\n 500: \"#84cc16\",\n 600: \"#65a30d\",\n 700: \"#4d7c0f\",\n 800: \"#3f6212\",\n 900: \"#365314\",\n 950: \"#1a2e05\"\n },\n green: {\n 50: \"#f0fdf4\",\n 100: \"#dcfce7\",\n 200: \"#bbf7d0\",\n 300: \"#86efac\",\n 400: \"#4ade80\",\n 500: \"#22c55e\",\n 600: \"#16a34a\",\n 700: \"#15803d\",\n 800: \"#166534\",\n 900: \"#14532d\",\n 950: \"#052e16\"\n },\n emerald: {\n 50: \"#ecfdf5\",\n 100: \"#d1fae5\",\n 200: \"#a7f3d0\",\n 300: \"#6ee7b7\",\n 400: \"#34d399\",\n 500: \"#10b981\",\n 600: \"#059669\",\n 700: \"#047857\",\n 800: \"#065f46\",\n 900: \"#064e3b\",\n 950: \"#022c22\"\n },\n teal: {\n 50: \"#f0fdfa\",\n 100: \"#ccfbf1\",\n 200: \"#99f6e4\",\n 300: \"#5eead4\",\n 400: \"#2dd4bf\",\n 500: \"#14b8a6\",\n 600: \"#0d9488\",\n 700: \"#0f766e\",\n 800: \"#115e59\",\n 900: \"#134e4a\",\n 950: \"#042f2e\"\n },\n cyan: {\n 50: \"#ecfeff\",\n 100: \"#cffafe\",\n 200: \"#a5f3fc\",\n 300: \"#67e8f9\",\n 400: \"#22d3ee\",\n 500: \"#06b6d4\",\n 600: \"#0891b2\",\n 700: \"#0e7490\",\n 800: \"#155e75\",\n 900: \"#164e63\",\n 950: \"#083344\"\n },\n sky: {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n 950: \"#082f49\"\n },\n blue: {\n 50: \"#eff6ff\",\n 100: \"#dbeafe\",\n 200: \"#bfdbfe\",\n 300: \"#93c5fd\",\n 400: \"#60a5fa\",\n 500: \"#3b82f6\",\n 600: \"#2563eb\",\n 700: \"#1d4ed8\",\n 800: \"#1e40af\",\n 900: \"#1e3a8a\",\n 950: \"#172554\"\n },\n indigo: {\n 50: \"#eef2ff\",\n 100: \"#e0e7ff\",\n 200: \"#c7d2fe\",\n 300: \"#a5b4fc\",\n 400: \"#818cf8\",\n 500: \"#6366f1\",\n 600: \"#4f46e5\",\n 700: \"#4338ca\",\n 800: \"#3730a3\",\n 900: \"#312e81\",\n 950: \"#1e1b4b\"\n },\n violet: {\n 50: \"#f5f3ff\",\n 100: \"#ede9fe\",\n 200: \"#ddd6fe\",\n 300: \"#c4b5fd\",\n 400: \"#a78bfa\",\n 500: \"#8b5cf6\",\n 600: \"#7c3aed\",\n 700: \"#6d28d9\",\n 800: \"#5b21b6\",\n 900: \"#4c1d95\",\n 950: \"#2e1065\"\n },\n purple: {\n 50: \"#faf5ff\",\n 100: \"#f3e8ff\",\n 200: \"#e9d5ff\",\n 300: \"#d8b4fe\",\n 400: \"#c084fc\",\n 500: \"#a855f7\",\n 600: \"#9333ea\",\n 700: \"#7e22ce\",\n 800: \"#6b21a8\",\n 900: \"#581c87\",\n 950: \"#3b0764\"\n },\n fuchsia: {\n 50: \"#fdf4ff\",\n 100: \"#fae8ff\",\n 200: \"#f5d0fe\",\n 300: \"#f0abfc\",\n 400: \"#e879f9\",\n 500: \"#d946ef\",\n 600: \"#c026d3\",\n 700: \"#a21caf\",\n 800: \"#86198f\",\n 900: \"#701a75\",\n 950: \"#4a044e\"\n },\n pink: {\n 50: \"#fdf2f8\",\n 100: \"#fce7f3\",\n 200: \"#fbcfe8\",\n 300: \"#f9a8d4\",\n 400: \"#f472b6\",\n 500: \"#ec4899\",\n 600: \"#db2777\",\n 700: \"#be185d\",\n 800: \"#9d174d\",\n 900: \"#831843\",\n 950: \"#500724\"\n },\n rose: {\n 50: \"#fff1f2\",\n 100: \"#ffe4e6\",\n 200: \"#fecdd3\",\n 300: \"#fda4af\",\n 400: \"#fb7185\",\n 500: \"#f43f5e\",\n 600: \"#e11d48\",\n 700: \"#be123c\",\n 800: \"#9f1239\",\n 900: \"#881337\",\n 950: \"#4c0519\"\n },\n get lightBlue () {\n warn({\n version: \"v2.2\",\n from: \"lightBlue\",\n to: \"sky\"\n });\n return this.sky;\n },\n get warmGray () {\n warn({\n version: \"v3.0\",\n from: \"warmGray\",\n to: \"stone\"\n });\n return this.stone;\n },\n get trueGray () {\n warn({\n version: \"v3.0\",\n from: \"trueGray\",\n to: \"neutral\"\n });\n return this.neutral;\n },\n get coolGray () {\n warn({\n version: \"v3.0\",\n from: \"coolGray\",\n to: \"gray\"\n });\n return this.gray;\n },\n get blueGray () {\n warn({\n version: \"v3.0\",\n from: \"blueGray\",\n to: \"slate\"\n });\n return this.slate;\n }\n};\n","let colors = require('./lib/public/colors')\nmodule.exports = (colors.__esModule ? colors : { default: colors }).default\n","import chroma, { InterpolationMode } from 'chroma-js';\n\nimport { DefaultColors } from 'tailwindcss/types/generated/colors.d.js';\nimport builtInColors from 'tailwindcss/colors.js';\n\nfunction keys(obj: T): (keyof T)[] {\n return Object.keys(obj) as (keyof T)[];\n}\n\nfunction entries(obj: T): [keyof T, T[keyof T]][] {\n return Object.entries(obj) as [keyof T, T[keyof T]][];\n}\n\nfunction hasOwn(obj: T, key: keyof T): key is keyof T {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n// valid color modes for chroma-js\nexport const validColorModes = [\n 'rgb',\n 'lab',\n 'lch',\n 'lrgb',\n 'hcl',\n 'num',\n 'hcg',\n 'oklch',\n 'hsi',\n 'hsl',\n 'hsv',\n 'oklab',\n] as const;\n\n// types for tailwind-lerp-colors\ntype Shades = Exclude | DefaultColors[keyof DefaultColors], string>;\ntype Colors = Record | DefaultColors;\ntype ColorMode = (typeof validColorModes)[number];\ntype Options = {\n includeBase?: boolean;\n includeLegacy?: boolean;\n lerpEnds?: boolean;\n interval?: number;\n mode?: ColorMode;\n};\ntype OptionName = keyof Options;\ntype Option = Options[T];\ntype SingularOptions = Pick;\n\n// default options for tailwind-lerp-colors -> lerpColor\nconst defaultSingleOptions: Required = {\n lerpEnds: true,\n interval: 25,\n mode: 'lrgb',\n};\n\n// default options for tailwind-lerp-colors -> lerpColors\nconst defaultOptions = {\n includeBase: true,\n includeLegacy: false,\n ...defaultSingleOptions,\n};\n\nconst isOptionInvalid = (options: Options, optionName: T, test: (k: Option) => boolean) => {\n return options && hasOwn(options, optionName) && !test(options[optionName]);\n};\n\nconst throwError = (message: string) => {\n throw new Error(message);\n};\n\nconst isValidShade = (shades: Shades | string): shades is Shades => {\n if (\n // undefined or null\n shades == null ||\n // check if shades is an object\n typeof shades !== 'object' ||\n // check if shades is an array\n Array.isArray(shades) ||\n shades.toString() !== '[object Object]' ||\n !keys(shades).some((key) => !isNaN(+key) && +key >= 0 && +key <= 1000)\n ) {\n return false;\n }\n return true;\n};\n\nexport const lerpColor = (shades: Shades, options: SingularOptions = {}) => {\n // validate lerpEnds\n if (isOptionInvalid(options, 'lerpEnds', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `lerpEnds` must be a boolean.');\n\n // validate interval\n if (isOptionInvalid(options, 'interval', (v) => Number.isInteger(v) && typeof v === 'number' && v > 0))\n throwError('tailwind-lerp-colors option `interval` must be a positive integer greater than 0.');\n\n // validate mode\n if (isOptionInvalid(options, 'mode', (v) => typeof v === 'string' && validColorModes.includes(v)))\n throwError(\n `tailwind-lerp-colors option \\`mode\\` must be one of the following values: ${validColorModes.join(', ')}.`\n );\n\n if (!isValidShade(shades))\n throwError(\n `tailwind-lerp-colors object \\`shades\\` must be an object with numeric keys.\\n\\nvalue used: ${JSON.stringify(\n shades,\n null,\n 2\n )}`\n );\n const { lerpEnds, interval, mode } = {\n ...defaultSingleOptions,\n ...(options ?? {}),\n };\n\n const sortByNumericFirstIndex = ([numericKeyA]: [number, string], [numericKeyB]: [number, string]) => {\n return numericKeyA - numericKeyB;\n };\n\n const namedShades: Record = {};\n const numericShades = entries(shades)\n .flatMap(([key, color]) => {\n const numericShade = +key;\n if (isNaN(numericShade)) {\n namedShades[key] = color;\n return [];\n }\n return [[numericShade, color]] as [[number, string]];\n })\n .sort(sortByNumericFirstIndex);\n\n if (lerpEnds) {\n if (numericShades[0]?.[0] !== 0) numericShades.unshift([0, '#ffffff']);\n if (numericShades.slice(-1)[0]?.[0] !== 1000) numericShades.push([1000, '#000000']);\n }\n const finalShades = [...numericShades];\n for (let i = 0; i < numericShades.length - 1; i++) {\n const [shade, color] = numericShades[i] ?? [];\n const [nextShade, nextColor] = numericShades[i + 1] ?? [];\n if (!shade || !color || !nextShade || !nextColor) {\n continue;\n }\n\n // check to make sure both shades being compared\n // are evenly divisible by the set interval\n const interpolations = (nextShade - shade) / interval - 1;\n if (interpolations <= 0 || !Number.isInteger(interpolations)) continue;\n\n const scale = chroma.scale([color, nextColor]).mode(mode as InterpolationMode);\n const getColorAt = (percent: number) => scale(percent).hex();\n for (let run = 1; run <= interpolations; run++) {\n const percent = run / (interpolations + 1);\n finalShades.push([shade + interval * run, getColorAt(percent)]);\n }\n }\n finalShades.sort(sortByNumericFirstIndex);\n\n return {\n ...Object.fromEntries(finalShades),\n ...namedShades,\n };\n};\n\nexport const lerpColors = (colorsObj: Colors = {}, options: Options = {}) => {\n // validate includeBase\n if (isOptionInvalid(options, 'includeBase', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeBase` must be a boolean.');\n\n // validate includeLegacy\n if (isOptionInvalid(options, 'includeLegacy', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeLegacy` must be a boolean.');\n\n const legacyNames = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray'];\n\n const { includeBase, includeLegacy, lerpEnds, interval, mode } = {\n ...defaultOptions,\n ...options,\n };\n const baseColors: Colors = {};\n if (includeBase) {\n const builtInColorKeys = keys(builtInColors);\n for (const key of builtInColorKeys) {\n if (!legacyNames.includes(key) || includeLegacy) {\n baseColors[key] = builtInColors[key];\n }\n }\n }\n\n const initialColors = entries({\n ...baseColors,\n ...colorsObj,\n });\n\n const finalColors: Colors = {};\n\n for (const [name, shades] of initialColors) {\n if (!isValidShade(shades)) {\n finalColors[name] = shades;\n } else {\n finalColors[name] = lerpColor(shades, { lerpEnds, interval, mode });\n }\n }\n\n return finalColors;\n};\n\nexport type {\n Shades as LerpColorsShades,\n Colors as LerpColorsColors,\n ColorMode as LerpColorsColorMode,\n Options as LerpColorsOptions,\n OptionName as LerpColorsOptionName,\n Option as LerpColorsOption,\n SingularOptions as LerpColorsSingularOptions,\n};\n"],"names":["x","String","create","isColorSupported","reset","bold","dim","italic","underline","inverse","hidden","strikethrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","picocolors_browser","Object","defineProperty","exports","value","target","all","name","enumerable","get","_export","default","_default","_picocolors","_interop_require_default","require$$0","obj","__esModule","alreadyShown","Set","log","type","messages","key","process","env","JEST_WORKER_ID","has","add","console","warn","forEach","message","input","info","Array","isArray","risk","_log","version","from","to","inherit","current","transparent","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","sky","indigo","violet","purple","fuchsia","pink","rose","lightBlue","this","warmGray","trueGray","coolGray","blueGray","colors_1","colors","keys","entries","validColorModes","defaultSingleOptions","lerpEnds","interval","mode","defaultOptions","_extends","includeBase","includeLegacy","isOptionInvalid","options","optionName","test","prototype","hasOwnProperty","call","throwError","Error","isValidShade","shades","toString","some","isNaN","lerpColor","_options","v","Number","isInteger","includes","join","JSON","stringify","_numericShades$","_numericShades$slice$","_defaultSingleOptions","sortByNumericFirstIndex","_ref","_ref2","namedShades","numericShades","flatMap","_ref3","color","numericShade","sort","unshift","slice","push","finalShades","concat","_loop","_numericShades$i","_numericShades","_ref4","i","shade","_ref5","nextShade","nextColor","percent","interpolations","scale","chroma","run","hex","length","fromEntries","colorsObj","legacyNames","_defaultOptions$optio","baseColors","_step","_iterator","_createForOfIteratorHelperLoose","builtInColors","done","_step2","finalColors","_iterator2","_step2$value"],"mappings":"8sCAAA,IAAIA,EAAEC,OACFC,EAAO,WAAY,MAAO,CAACC,kBAAiB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,EAAA1I,MACPuI,EAAYxC,SAAS5E,KAAQwD,IAChC8D,EAAWtH,GAAO0H,EAAc1H,GAEnC,CAUH,IAPA,IAO0C4H,EAFpCC,EAAsB,CAAA,EAE5BC,EAAAL,EAPsB1E,EAAOO,EACxBgE,CAAAA,EAAAA,EACAH,OAKqCS,EAAAE,KAAAH,MAAE,CAAA,IAAAI,EAAAH,EAAA/I,MAA1BsF,EAAM4D,KAIpBF,EAJYE,EAAE5D,IACXD,EAAaC,GAGII,EAAUJ,EAAQ,CAAEjB,SAAAA,EAAUC,SAAAA,EAAUC,KAAAA,IAFxCe,CAIvB,CAED,OAAO0D,CACT"} -------------------------------------------------------------------------------- /dist/index.modern.js: -------------------------------------------------------------------------------- 1 | import e from"chroma-js";function f(){return f=Object.assign?Object.assign.bind():function(e){for(var f=1;fconsole.warn(e,"-",f)))}function c(e){return a.default.dim(e)}const d={info(e,f){n(a.default.bold(a.default.cyan("info")),...Array.isArray(e)?[e]:[f,e])},warn(e,f){n(a.default.bold(a.default.yellow("warn")),...Array.isArray(e)?[e]:[f,e])},risk(e,f){n(a.default.bold(a.default.magenta("risk")),...Array.isArray(e)?[e]:[f,e])}}}),d=a(function(e,f){Object.defineProperty(f,"__esModule",{value:!0}),Object.defineProperty(f,"default",{enumerable:!0,get:function(){return n}});const a=/*#__PURE__*/r(c);function r(e){return e&&e.__esModule?e:{default:e}}function t({version:e,from:f,to:r}){a.default.warn(`${f}-color-renamed`,[`As of Tailwind CSS ${e}, \`${f}\` has been renamed to \`${r}\`.`,"Update your configuration file to silence this warning."])}const n={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return t({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return t({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return t({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return t({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return t({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}),l=(d.__esModule?d:{default:d}).default;function i(e){return Object.keys(e)}function s(e){return Object.entries(e)}const b=["rgb","lab","lch","lrgb","hcl","num","hcg","oklch","hsi","hsl","hsv","oklab"],u={lerpEnds:!0,interval:25,mode:"lrgb"},y=f({includeBase:!0,includeLegacy:!1},u),p=(e,f,a)=>e&&Object.prototype.hasOwnProperty.call(e,f)&&!a(e[f]),g=e=>{throw new Error(e)},m=e=>!(null==e||"object"!=typeof e||Array.isArray(e)||"[object Object]"!==e.toString()||!i(e).some(e=>!isNaN(+e)&&+e>=0&&+e<=1e3)),h=(a,r={})=>{p(r,"lerpEnds",e=>"boolean"==typeof e)&&g("tailwind-lerp-colors option `lerpEnds` must be a boolean."),p(r,"interval",e=>Number.isInteger(e)&&"number"==typeof e&&e>0)&&g("tailwind-lerp-colors option `interval` must be a positive integer greater than 0."),p(r,"mode",e=>"string"==typeof e&&b.includes(e))&&g(`tailwind-lerp-colors option \`mode\` must be one of the following values: ${b.join(", ")}.`),m(a)||g(`tailwind-lerp-colors object \`shades\` must be an object with numeric keys.\n\nvalue used: ${JSON.stringify(a,null,2)}`);const{lerpEnds:t,interval:n,mode:o}=f({},u,null!=r?r:{}),c=([e],[f])=>e-f,d={},l=s(a).flatMap(([e,f])=>{const a=+e;return isNaN(a)?(d[e]=f,[]):[[a,f]]}).sort(c);var i,y;t&&(0!==(null==(i=l[0])?void 0:i[0])&&l.unshift([0,"#ffffff"]),1e3!==(null==(y=l.slice(-1)[0])?void 0:y[0])&&l.push([1e3,"#000000"]));const h=[...l];for(let f=0;fi(e).hex();for(let e=1;e<=d;e++)h.push([a+n*e,s(e/(d+1))])}return h.sort(c),f({},Object.fromEntries(h),d)},v=(e={},a={})=>{p(a,"includeBase",e=>"boolean"==typeof e)&&g("tailwind-lerp-colors option `includeBase` must be a boolean."),p(a,"includeLegacy",e=>"boolean"==typeof e)&&g("tailwind-lerp-colors option `includeLegacy` must be a boolean.");const r=["lightBlue","warmGray","trueGray","coolGray","blueGray"],{includeBase:t,includeLegacy:n,lerpEnds:o,interval:c,mode:d}=f({},y,a),b={};if(t){const e=i(l);for(const f of e)r.includes(f)&&!n||(b[f]=l[f])}const u=s(f({},b,e)),v={};for(const[e,f]of u)v[e]=m(f)?h(f,{lerpEnds:o,interval:c,mode:d}):f;return v};export{h as lerpColor,v as lerpColors,b as validColorModes}; 2 | //# sourceMappingURL=index.modern.js.map 3 | -------------------------------------------------------------------------------- /dist/index.modern.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.modern.js","sources":["../node_modules/picocolors/picocolors.browser.js","../node_modules/tailwindcss/lib/util/log.js","../node_modules/tailwindcss/lib/public/colors.js","../node_modules/tailwindcss/colors.js","../index.ts"],"sourcesContent":["var x=String;\nvar create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};\nmodule.exports=create();\nmodule.exports.createColors = create;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n dim: function() {\n return dim;\n },\n default: function() {\n return _default;\n }\n});\nconst _picocolors = /*#__PURE__*/ _interop_require_default(require(\"picocolors\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nlet alreadyShown = new Set();\nfunction log(type, messages, key) {\n if (typeof process !== \"undefined\" && process.env.JEST_WORKER_ID) return;\n if (key && alreadyShown.has(key)) return;\n if (key) alreadyShown.add(key);\n console.warn(\"\");\n messages.forEach((message)=>console.warn(type, \"-\", message));\n}\nfunction dim(input) {\n return _picocolors.default.dim(input);\n}\nconst _default = {\n info (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.cyan(\"info\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n warn (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.yellow(\"warn\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n risk (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.magenta(\"risk\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _log = /*#__PURE__*/ _interop_require_default(require(\"../util/log\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction warn({ version , from , to }) {\n _log.default.warn(`${from}-color-renamed`, [\n `As of Tailwind CSS ${version}, \\`${from}\\` has been renamed to \\`${to}\\`.`,\n \"Update your configuration file to silence this warning.\"\n ]);\n}\nconst _default = {\n inherit: \"inherit\",\n current: \"currentColor\",\n transparent: \"transparent\",\n black: \"#000\",\n white: \"#fff\",\n slate: {\n 50: \"#f8fafc\",\n 100: \"#f1f5f9\",\n 200: \"#e2e8f0\",\n 300: \"#cbd5e1\",\n 400: \"#94a3b8\",\n 500: \"#64748b\",\n 600: \"#475569\",\n 700: \"#334155\",\n 800: \"#1e293b\",\n 900: \"#0f172a\",\n 950: \"#020617\"\n },\n gray: {\n 50: \"#f9fafb\",\n 100: \"#f3f4f6\",\n 200: \"#e5e7eb\",\n 300: \"#d1d5db\",\n 400: \"#9ca3af\",\n 500: \"#6b7280\",\n 600: \"#4b5563\",\n 700: \"#374151\",\n 800: \"#1f2937\",\n 900: \"#111827\",\n 950: \"#030712\"\n },\n zinc: {\n 50: \"#fafafa\",\n 100: \"#f4f4f5\",\n 200: \"#e4e4e7\",\n 300: \"#d4d4d8\",\n 400: \"#a1a1aa\",\n 500: \"#71717a\",\n 600: \"#52525b\",\n 700: \"#3f3f46\",\n 800: \"#27272a\",\n 900: \"#18181b\",\n 950: \"#09090b\"\n },\n neutral: {\n 50: \"#fafafa\",\n 100: \"#f5f5f5\",\n 200: \"#e5e5e5\",\n 300: \"#d4d4d4\",\n 400: \"#a3a3a3\",\n 500: \"#737373\",\n 600: \"#525252\",\n 700: \"#404040\",\n 800: \"#262626\",\n 900: \"#171717\",\n 950: \"#0a0a0a\"\n },\n stone: {\n 50: \"#fafaf9\",\n 100: \"#f5f5f4\",\n 200: \"#e7e5e4\",\n 300: \"#d6d3d1\",\n 400: \"#a8a29e\",\n 500: \"#78716c\",\n 600: \"#57534e\",\n 700: \"#44403c\",\n 800: \"#292524\",\n 900: \"#1c1917\",\n 950: \"#0c0a09\"\n },\n red: {\n 50: \"#fef2f2\",\n 100: \"#fee2e2\",\n 200: \"#fecaca\",\n 300: \"#fca5a5\",\n 400: \"#f87171\",\n 500: \"#ef4444\",\n 600: \"#dc2626\",\n 700: \"#b91c1c\",\n 800: \"#991b1b\",\n 900: \"#7f1d1d\",\n 950: \"#450a0a\"\n },\n orange: {\n 50: \"#fff7ed\",\n 100: \"#ffedd5\",\n 200: \"#fed7aa\",\n 300: \"#fdba74\",\n 400: \"#fb923c\",\n 500: \"#f97316\",\n 600: \"#ea580c\",\n 700: \"#c2410c\",\n 800: \"#9a3412\",\n 900: \"#7c2d12\",\n 950: \"#431407\"\n },\n amber: {\n 50: \"#fffbeb\",\n 100: \"#fef3c7\",\n 200: \"#fde68a\",\n 300: \"#fcd34d\",\n 400: \"#fbbf24\",\n 500: \"#f59e0b\",\n 600: \"#d97706\",\n 700: \"#b45309\",\n 800: \"#92400e\",\n 900: \"#78350f\",\n 950: \"#451a03\"\n },\n yellow: {\n 50: \"#fefce8\",\n 100: \"#fef9c3\",\n 200: \"#fef08a\",\n 300: \"#fde047\",\n 400: \"#facc15\",\n 500: \"#eab308\",\n 600: \"#ca8a04\",\n 700: \"#a16207\",\n 800: \"#854d0e\",\n 900: \"#713f12\",\n 950: \"#422006\"\n },\n lime: {\n 50: \"#f7fee7\",\n 100: \"#ecfccb\",\n 200: \"#d9f99d\",\n 300: \"#bef264\",\n 400: \"#a3e635\",\n 500: \"#84cc16\",\n 600: \"#65a30d\",\n 700: \"#4d7c0f\",\n 800: \"#3f6212\",\n 900: \"#365314\",\n 950: \"#1a2e05\"\n },\n green: {\n 50: \"#f0fdf4\",\n 100: \"#dcfce7\",\n 200: \"#bbf7d0\",\n 300: \"#86efac\",\n 400: \"#4ade80\",\n 500: \"#22c55e\",\n 600: \"#16a34a\",\n 700: \"#15803d\",\n 800: \"#166534\",\n 900: \"#14532d\",\n 950: \"#052e16\"\n },\n emerald: {\n 50: \"#ecfdf5\",\n 100: \"#d1fae5\",\n 200: \"#a7f3d0\",\n 300: \"#6ee7b7\",\n 400: \"#34d399\",\n 500: \"#10b981\",\n 600: \"#059669\",\n 700: \"#047857\",\n 800: \"#065f46\",\n 900: \"#064e3b\",\n 950: \"#022c22\"\n },\n teal: {\n 50: \"#f0fdfa\",\n 100: \"#ccfbf1\",\n 200: \"#99f6e4\",\n 300: \"#5eead4\",\n 400: \"#2dd4bf\",\n 500: \"#14b8a6\",\n 600: \"#0d9488\",\n 700: \"#0f766e\",\n 800: \"#115e59\",\n 900: \"#134e4a\",\n 950: \"#042f2e\"\n },\n cyan: {\n 50: \"#ecfeff\",\n 100: \"#cffafe\",\n 200: \"#a5f3fc\",\n 300: \"#67e8f9\",\n 400: \"#22d3ee\",\n 500: \"#06b6d4\",\n 600: \"#0891b2\",\n 700: \"#0e7490\",\n 800: \"#155e75\",\n 900: \"#164e63\",\n 950: \"#083344\"\n },\n sky: {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n 950: \"#082f49\"\n },\n blue: {\n 50: \"#eff6ff\",\n 100: \"#dbeafe\",\n 200: \"#bfdbfe\",\n 300: \"#93c5fd\",\n 400: \"#60a5fa\",\n 500: \"#3b82f6\",\n 600: \"#2563eb\",\n 700: \"#1d4ed8\",\n 800: \"#1e40af\",\n 900: \"#1e3a8a\",\n 950: \"#172554\"\n },\n indigo: {\n 50: \"#eef2ff\",\n 100: \"#e0e7ff\",\n 200: \"#c7d2fe\",\n 300: \"#a5b4fc\",\n 400: \"#818cf8\",\n 500: \"#6366f1\",\n 600: \"#4f46e5\",\n 700: \"#4338ca\",\n 800: \"#3730a3\",\n 900: \"#312e81\",\n 950: \"#1e1b4b\"\n },\n violet: {\n 50: \"#f5f3ff\",\n 100: \"#ede9fe\",\n 200: \"#ddd6fe\",\n 300: \"#c4b5fd\",\n 400: \"#a78bfa\",\n 500: \"#8b5cf6\",\n 600: \"#7c3aed\",\n 700: \"#6d28d9\",\n 800: \"#5b21b6\",\n 900: \"#4c1d95\",\n 950: \"#2e1065\"\n },\n purple: {\n 50: \"#faf5ff\",\n 100: \"#f3e8ff\",\n 200: \"#e9d5ff\",\n 300: \"#d8b4fe\",\n 400: \"#c084fc\",\n 500: \"#a855f7\",\n 600: \"#9333ea\",\n 700: \"#7e22ce\",\n 800: \"#6b21a8\",\n 900: \"#581c87\",\n 950: \"#3b0764\"\n },\n fuchsia: {\n 50: \"#fdf4ff\",\n 100: \"#fae8ff\",\n 200: \"#f5d0fe\",\n 300: \"#f0abfc\",\n 400: \"#e879f9\",\n 500: \"#d946ef\",\n 600: \"#c026d3\",\n 700: \"#a21caf\",\n 800: \"#86198f\",\n 900: \"#701a75\",\n 950: \"#4a044e\"\n },\n pink: {\n 50: \"#fdf2f8\",\n 100: \"#fce7f3\",\n 200: \"#fbcfe8\",\n 300: \"#f9a8d4\",\n 400: \"#f472b6\",\n 500: \"#ec4899\",\n 600: \"#db2777\",\n 700: \"#be185d\",\n 800: \"#9d174d\",\n 900: \"#831843\",\n 950: \"#500724\"\n },\n rose: {\n 50: \"#fff1f2\",\n 100: \"#ffe4e6\",\n 200: \"#fecdd3\",\n 300: \"#fda4af\",\n 400: \"#fb7185\",\n 500: \"#f43f5e\",\n 600: \"#e11d48\",\n 700: \"#be123c\",\n 800: \"#9f1239\",\n 900: \"#881337\",\n 950: \"#4c0519\"\n },\n get lightBlue () {\n warn({\n version: \"v2.2\",\n from: \"lightBlue\",\n to: \"sky\"\n });\n return this.sky;\n },\n get warmGray () {\n warn({\n version: \"v3.0\",\n from: \"warmGray\",\n to: \"stone\"\n });\n return this.stone;\n },\n get trueGray () {\n warn({\n version: \"v3.0\",\n from: \"trueGray\",\n to: \"neutral\"\n });\n return this.neutral;\n },\n get coolGray () {\n warn({\n version: \"v3.0\",\n from: \"coolGray\",\n to: \"gray\"\n });\n return this.gray;\n },\n get blueGray () {\n warn({\n version: \"v3.0\",\n from: \"blueGray\",\n to: \"slate\"\n });\n return this.slate;\n }\n};\n","let colors = require('./lib/public/colors')\nmodule.exports = (colors.__esModule ? colors : { default: colors }).default\n","import chroma, { InterpolationMode } from 'chroma-js';\n\nimport { DefaultColors } from 'tailwindcss/types/generated/colors.d.js';\nimport builtInColors from 'tailwindcss/colors.js';\n\nfunction keys(obj: T): (keyof T)[] {\n return Object.keys(obj) as (keyof T)[];\n}\n\nfunction entries(obj: T): [keyof T, T[keyof T]][] {\n return Object.entries(obj) as [keyof T, T[keyof T]][];\n}\n\nfunction hasOwn(obj: T, key: keyof T): key is keyof T {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n// valid color modes for chroma-js\nexport const validColorModes = [\n 'rgb',\n 'lab',\n 'lch',\n 'lrgb',\n 'hcl',\n 'num',\n 'hcg',\n 'oklch',\n 'hsi',\n 'hsl',\n 'hsv',\n 'oklab',\n] as const;\n\n// types for tailwind-lerp-colors\ntype Shades = Exclude | DefaultColors[keyof DefaultColors], string>;\ntype Colors = Record | DefaultColors;\ntype ColorMode = (typeof validColorModes)[number];\ntype Options = {\n includeBase?: boolean;\n includeLegacy?: boolean;\n lerpEnds?: boolean;\n interval?: number;\n mode?: ColorMode;\n};\ntype OptionName = keyof Options;\ntype Option = Options[T];\ntype SingularOptions = Pick;\n\n// default options for tailwind-lerp-colors -> lerpColor\nconst defaultSingleOptions: Required = {\n lerpEnds: true,\n interval: 25,\n mode: 'lrgb',\n};\n\n// default options for tailwind-lerp-colors -> lerpColors\nconst defaultOptions = {\n includeBase: true,\n includeLegacy: false,\n ...defaultSingleOptions,\n};\n\nconst isOptionInvalid = (options: Options, optionName: T, test: (k: Option) => boolean) => {\n return options && hasOwn(options, optionName) && !test(options[optionName]);\n};\n\nconst throwError = (message: string) => {\n throw new Error(message);\n};\n\nconst isValidShade = (shades: Shades | string): shades is Shades => {\n if (\n // undefined or null\n shades == null ||\n // check if shades is an object\n typeof shades !== 'object' ||\n // check if shades is an array\n Array.isArray(shades) ||\n shades.toString() !== '[object Object]' ||\n !keys(shades).some((key) => !isNaN(+key) && +key >= 0 && +key <= 1000)\n ) {\n return false;\n }\n return true;\n};\n\nexport const lerpColor = (shades: Shades, options: SingularOptions = {}) => {\n // validate lerpEnds\n if (isOptionInvalid(options, 'lerpEnds', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `lerpEnds` must be a boolean.');\n\n // validate interval\n if (isOptionInvalid(options, 'interval', (v) => Number.isInteger(v) && typeof v === 'number' && v > 0))\n throwError('tailwind-lerp-colors option `interval` must be a positive integer greater than 0.');\n\n // validate mode\n if (isOptionInvalid(options, 'mode', (v) => typeof v === 'string' && validColorModes.includes(v)))\n throwError(\n `tailwind-lerp-colors option \\`mode\\` must be one of the following values: ${validColorModes.join(', ')}.`\n );\n\n if (!isValidShade(shades))\n throwError(\n `tailwind-lerp-colors object \\`shades\\` must be an object with numeric keys.\\n\\nvalue used: ${JSON.stringify(\n shades,\n null,\n 2\n )}`\n );\n const { lerpEnds, interval, mode } = {\n ...defaultSingleOptions,\n ...(options ?? {}),\n };\n\n const sortByNumericFirstIndex = ([numericKeyA]: [number, string], [numericKeyB]: [number, string]) => {\n return numericKeyA - numericKeyB;\n };\n\n const namedShades: Record = {};\n const numericShades = entries(shades)\n .flatMap(([key, color]) => {\n const numericShade = +key;\n if (isNaN(numericShade)) {\n namedShades[key] = color;\n return [];\n }\n return [[numericShade, color]] as [[number, string]];\n })\n .sort(sortByNumericFirstIndex);\n\n if (lerpEnds) {\n if (numericShades[0]?.[0] !== 0) numericShades.unshift([0, '#ffffff']);\n if (numericShades.slice(-1)[0]?.[0] !== 1000) numericShades.push([1000, '#000000']);\n }\n const finalShades = [...numericShades];\n for (let i = 0; i < numericShades.length - 1; i++) {\n const [shade, color] = numericShades[i] ?? [];\n const [nextShade, nextColor] = numericShades[i + 1] ?? [];\n if (!shade || !color || !nextShade || !nextColor) {\n continue;\n }\n\n // check to make sure both shades being compared\n // are evenly divisible by the set interval\n const interpolations = (nextShade - shade) / interval - 1;\n if (interpolations <= 0 || !Number.isInteger(interpolations)) continue;\n\n const scale = chroma.scale([color, nextColor]).mode(mode as InterpolationMode);\n const getColorAt = (percent: number) => scale(percent).hex();\n for (let run = 1; run <= interpolations; run++) {\n const percent = run / (interpolations + 1);\n finalShades.push([shade + interval * run, getColorAt(percent)]);\n }\n }\n finalShades.sort(sortByNumericFirstIndex);\n\n return {\n ...Object.fromEntries(finalShades),\n ...namedShades,\n };\n};\n\nexport const lerpColors = (colorsObj: Colors = {}, options: Options = {}) => {\n // validate includeBase\n if (isOptionInvalid(options, 'includeBase', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeBase` must be a boolean.');\n\n // validate includeLegacy\n if (isOptionInvalid(options, 'includeLegacy', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeLegacy` must be a boolean.');\n\n const legacyNames = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray'];\n\n const { includeBase, includeLegacy, lerpEnds, interval, mode } = {\n ...defaultOptions,\n ...options,\n };\n const baseColors: Colors = {};\n if (includeBase) {\n const builtInColorKeys = keys(builtInColors);\n for (const key of builtInColorKeys) {\n if (!legacyNames.includes(key) || includeLegacy) {\n baseColors[key] = builtInColors[key];\n }\n }\n }\n\n const initialColors = entries({\n ...baseColors,\n ...colorsObj,\n });\n\n const finalColors: Colors = {};\n\n for (const [name, shades] of initialColors) {\n if (!isValidShade(shades)) {\n finalColors[name] = shades;\n } else {\n finalColors[name] = lerpColor(shades, { lerpEnds, interval, mode });\n }\n }\n\n return finalColors;\n};\n\nexport type {\n Shades as LerpColorsShades,\n Colors as LerpColorsColors,\n ColorMode as LerpColorsColorMode,\n Options as LerpColorsOptions,\n OptionName as LerpColorsOptionName,\n Option as LerpColorsOption,\n SingularOptions as LerpColorsSingularOptions,\n};\n"],"names":["x","String","create","isColorSupported","reset","bold","dim","italic","underline","inverse","hidden","strikethrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","picocolors_browser","Object","defineProperty","exports","value","target","all","name","enumerable","get","_export","default","_default","_picocolors","_interop_require_default","require$$0","obj","__esModule","alreadyShown","Set","log","type","messages","key","process","env","JEST_WORKER_ID","has","add","console","warn","forEach","message","input","info","Array","isArray","risk","_log","version","from","to","inherit","current","transparent","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","sky","indigo","violet","purple","fuchsia","pink","rose","lightBlue","this","warmGray","trueGray","coolGray","blueGray","colors_1","colors","keys","entries","validColorModes","defaultSingleOptions","lerpEnds","interval","mode","defaultOptions","_extends","includeBase","includeLegacy","isOptionInvalid","options","optionName","test","prototype","hasOwnProperty","call","throwError","Error","isValidShade","shades","toString","some","isNaN","lerpColor","v","Number","isInteger","includes","join","JSON","stringify","sortByNumericFirstIndex","numericKeyA","numericKeyB","namedShades","numericShades","flatMap","color","numericShade","sort","_numericShades$","_numericShades$slice$","unshift","slice","push","finalShades","i","length","_numericShades$i","_numericShades","shade","nextShade","nextColor","interpolations","scale","chroma","getColorAt","percent","hex","run","fromEntries","lerpColors","colorsObj","legacyNames","baseColors","builtInColorKeys","builtInColors","initialColors","finalColors"],"mappings":"8TAAA,IAAIA,EAAEC,OACFC,EAAO,WAAY,MAAO,CAACC,kBAAiB,EAAMC,MAAMJ,EAAEK,KAAKL,EAAEM,IAAIN,EAAEO,OAAOP,EAAEQ,UAAUR,EAAES,QAAQT,EAAEU,OAAOV,EAAEW,cAAcX,EAAEY,MAAMZ,EAAEa,IAAIb,EAAEc,MAAMd,EAAEe,OAAOf,EAAEgB,KAAKhB,EAAEiB,QAAQjB,EAAEkB,KAAKlB,EAAEmB,MAAMnB,EAAEoB,KAAKpB,EAAEqB,QAAQrB,EAAEsB,MAAMtB,EAAEuB,QAAQvB,EAAEwB,SAASxB,EAAEyB,OAAOzB,EAAE0B,UAAU1B,EAAE2B,OAAO3B,EAAE4B,QAAQ5B,EAAE,EAC1Q6B,EAAC3B,mBACeA,4BCF9B4B,OAAOC,eAAwBC,EAAA,aAAc,CACzCC,OAAO,IAEX,SAAiBC,EAAQC,GACrB,IAAI,IAAIC,KAAQD,EAAIL,OAAOC,eAAeG,EAAQE,EAAM,CACpDC,YAAY,EACZC,IAAKH,EAAIC,IAEjB,CACAG,CAAQP,EAAS,CACb1B,IAAK,WACD,OAAOA,CACV,EACDkC,QAAS,WACL,OAAOC,CACV,IAEL,MAA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ECsD,EAAqB,CAAE,EAC7B,GAAIzD,EAAa,CACf,MAAM0D,EAAmBnE,EAAKoE,GAC9B,IAAK,MAAMlH,KAAOiH,EACXF,EAAYpC,SAAS3E,KAAQwD,IAChCwD,EAAWhH,GAAOkH,EAAclH,GAGrC,CAED,MAAMmH,EAAgBpE,EAAOO,EAAA,CAAA,EACxB0D,EACAF,IAGCM,EAAsB,CAAA,EAE5B,IAAK,MAAOpI,EAAMmF,KAAWgD,EAIzBC,EAAYpI,GAHTkF,EAAaC,GAGII,EAAUJ,EAAQ,CAAEjB,WAAUC,WAAUC,SAFxCe,EAMxB,OAAOiD"} -------------------------------------------------------------------------------- /dist/index.module.js: -------------------------------------------------------------------------------- 1 | import e from"chroma-js";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;re.length)&&(r=e.length);for(var f=0,n=new Array(r);f=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e){var r={exports:{}};return e(r,r.exports),r.exports}var t=String,o=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}},c=o();c.createColors=o;var i=c,d=a(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),function(e,r){for(var f in r)Object.defineProperty(e,f,{enumerable:!0,get:r[f]})}(r,{dim:function(){return o},default:function(){return c}});const f=/*#__PURE__*/n(i);function n(e){return e&&e.__esModule?e:{default:e}}let a=new Set;function t(e,r,f){"undefined"!=typeof process&&process.env.JEST_WORKER_ID||f&&a.has(f)||(f&&a.add(f),console.warn(""),r.forEach(r=>console.warn(e,"-",r)))}function o(e){return f.default.dim(e)}const c={info(e,r){t(f.default.bold(f.default.cyan("info")),...Array.isArray(e)?[e]:[r,e])},warn(e,r){t(f.default.bold(f.default.yellow("warn")),...Array.isArray(e)?[e]:[r,e])},risk(e,r){t(f.default.bold(f.default.magenta("risk")),...Array.isArray(e)?[e]:[r,e])}}}),l=a(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return t}});const f=/*#__PURE__*/n(d);function n(e){return e&&e.__esModule?e:{default:e}}function a({version:e,from:r,to:n}){f.default.warn(`${r}-color-renamed`,[`As of Tailwind CSS ${e}, \`${r}\` has been renamed to \`${n}\`.`,"Update your configuration file to silence this warning."])}const t={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}),u=(l.__esModule?l:{default:l}).default;function b(e){return Object.keys(e)}function s(e){return Object.entries(e)}var y=["rgb","lab","lch","lrgb","hcl","num","hcg","oklch","hsi","hsl","hsv","oklab"],p={lerpEnds:!0,interval:25,mode:"lrgb"},v=r({includeBase:!0,includeLegacy:!1},p),g=function(e,r,f){return e&&Object.prototype.hasOwnProperty.call(e,r)&&!f(e[r])},m=function(e){throw new Error(e)},h=function(e){return!(null==e||"object"!=typeof e||Array.isArray(e)||"[object Object]"!==e.toString()||!b(e).some(function(e){return!isNaN(+e)&&+e>=0&&+e<=1e3}))},w=function(f,n){var a;void 0===n&&(n={}),g(n,"lerpEnds",function(e){return"boolean"==typeof e})&&m("tailwind-lerp-colors option `lerpEnds` must be a boolean."),g(n,"interval",function(e){return Number.isInteger(e)&&"number"==typeof e&&e>0})&&m("tailwind-lerp-colors option `interval` must be a positive integer greater than 0."),g(n,"mode",function(e){return"string"==typeof e&&y.includes(e)})&&m("tailwind-lerp-colors option `mode` must be one of the following values: "+y.join(", ")+"."),h(f)||m("tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: "+JSON.stringify(f,null,2));var t,o,c=r({},p,null!=(a=n)?a:{}),i=c.lerpEnds,d=c.interval,l=c.mode,u=function(e,r){return e[0]-r[0]},b={},v=s(f).flatMap(function(e){var r=e[0],f=e[1],n=+r;return isNaN(n)?(b[r]=f,[]):[[n,f]]}).sort(u);i&&(0!==(null==(t=v[0])?void 0:t[0])&&v.unshift([0,"#ffffff"]),1e3!==(null==(o=v.slice(-1)[0])?void 0:o[0])&&v.push([1e3,"#000000"]));for(var w=[].concat(v),j=function(){var r,f,n=null!=(r=v[O])?r:[],a=n[0],t=n[1],o=null!=(f=v[O+1])?f:[],c=o[0],i=o[1];if(!(a&&t&&c&&i))return 0;var u,b=(c-a)/d-1;if(b<=0||!Number.isInteger(b))return 0;for(var s=e.scale([t,i]).mode(l),y=1;y<=b;y++)w.push([a+d*y,(u=y/(b+1),s(u).hex())])},O=0;Oconsole.warn(type, \"-\", message));\n}\nfunction dim(input) {\n return _picocolors.default.dim(input);\n}\nconst _default = {\n info (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.cyan(\"info\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n warn (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.yellow(\"warn\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n risk (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.magenta(\"risk\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _log = /*#__PURE__*/ _interop_require_default(require(\"../util/log\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction warn({ version , from , to }) {\n _log.default.warn(`${from}-color-renamed`, [\n `As of Tailwind CSS ${version}, \\`${from}\\` has been renamed to \\`${to}\\`.`,\n \"Update your configuration file to silence this warning.\"\n ]);\n}\nconst _default = {\n inherit: \"inherit\",\n current: \"currentColor\",\n transparent: \"transparent\",\n black: \"#000\",\n white: \"#fff\",\n slate: {\n 50: \"#f8fafc\",\n 100: \"#f1f5f9\",\n 200: \"#e2e8f0\",\n 300: \"#cbd5e1\",\n 400: \"#94a3b8\",\n 500: \"#64748b\",\n 600: \"#475569\",\n 700: \"#334155\",\n 800: \"#1e293b\",\n 900: \"#0f172a\",\n 950: \"#020617\"\n },\n gray: {\n 50: \"#f9fafb\",\n 100: \"#f3f4f6\",\n 200: \"#e5e7eb\",\n 300: \"#d1d5db\",\n 400: \"#9ca3af\",\n 500: \"#6b7280\",\n 600: \"#4b5563\",\n 700: \"#374151\",\n 800: \"#1f2937\",\n 900: \"#111827\",\n 950: \"#030712\"\n },\n zinc: {\n 50: \"#fafafa\",\n 100: \"#f4f4f5\",\n 200: \"#e4e4e7\",\n 300: \"#d4d4d8\",\n 400: \"#a1a1aa\",\n 500: \"#71717a\",\n 600: \"#52525b\",\n 700: \"#3f3f46\",\n 800: \"#27272a\",\n 900: \"#18181b\",\n 950: \"#09090b\"\n },\n neutral: {\n 50: \"#fafafa\",\n 100: \"#f5f5f5\",\n 200: \"#e5e5e5\",\n 300: \"#d4d4d4\",\n 400: \"#a3a3a3\",\n 500: \"#737373\",\n 600: \"#525252\",\n 700: \"#404040\",\n 800: \"#262626\",\n 900: \"#171717\",\n 950: \"#0a0a0a\"\n },\n stone: {\n 50: \"#fafaf9\",\n 100: \"#f5f5f4\",\n 200: \"#e7e5e4\",\n 300: \"#d6d3d1\",\n 400: \"#a8a29e\",\n 500: \"#78716c\",\n 600: \"#57534e\",\n 700: \"#44403c\",\n 800: \"#292524\",\n 900: \"#1c1917\",\n 950: \"#0c0a09\"\n },\n red: {\n 50: \"#fef2f2\",\n 100: \"#fee2e2\",\n 200: \"#fecaca\",\n 300: \"#fca5a5\",\n 400: \"#f87171\",\n 500: \"#ef4444\",\n 600: \"#dc2626\",\n 700: \"#b91c1c\",\n 800: \"#991b1b\",\n 900: \"#7f1d1d\",\n 950: \"#450a0a\"\n },\n orange: {\n 50: \"#fff7ed\",\n 100: \"#ffedd5\",\n 200: \"#fed7aa\",\n 300: \"#fdba74\",\n 400: \"#fb923c\",\n 500: \"#f97316\",\n 600: \"#ea580c\",\n 700: \"#c2410c\",\n 800: \"#9a3412\",\n 900: \"#7c2d12\",\n 950: \"#431407\"\n },\n amber: {\n 50: \"#fffbeb\",\n 100: \"#fef3c7\",\n 200: \"#fde68a\",\n 300: \"#fcd34d\",\n 400: \"#fbbf24\",\n 500: \"#f59e0b\",\n 600: \"#d97706\",\n 700: \"#b45309\",\n 800: \"#92400e\",\n 900: \"#78350f\",\n 950: \"#451a03\"\n },\n yellow: {\n 50: \"#fefce8\",\n 100: \"#fef9c3\",\n 200: \"#fef08a\",\n 300: \"#fde047\",\n 400: \"#facc15\",\n 500: \"#eab308\",\n 600: \"#ca8a04\",\n 700: \"#a16207\",\n 800: \"#854d0e\",\n 900: \"#713f12\",\n 950: \"#422006\"\n },\n lime: {\n 50: \"#f7fee7\",\n 100: \"#ecfccb\",\n 200: \"#d9f99d\",\n 300: \"#bef264\",\n 400: \"#a3e635\",\n 500: \"#84cc16\",\n 600: \"#65a30d\",\n 700: \"#4d7c0f\",\n 800: \"#3f6212\",\n 900: \"#365314\",\n 950: \"#1a2e05\"\n },\n green: {\n 50: \"#f0fdf4\",\n 100: \"#dcfce7\",\n 200: \"#bbf7d0\",\n 300: \"#86efac\",\n 400: \"#4ade80\",\n 500: \"#22c55e\",\n 600: \"#16a34a\",\n 700: \"#15803d\",\n 800: \"#166534\",\n 900: \"#14532d\",\n 950: \"#052e16\"\n },\n emerald: {\n 50: \"#ecfdf5\",\n 100: \"#d1fae5\",\n 200: \"#a7f3d0\",\n 300: \"#6ee7b7\",\n 400: \"#34d399\",\n 500: \"#10b981\",\n 600: \"#059669\",\n 700: \"#047857\",\n 800: \"#065f46\",\n 900: \"#064e3b\",\n 950: \"#022c22\"\n },\n teal: {\n 50: \"#f0fdfa\",\n 100: \"#ccfbf1\",\n 200: \"#99f6e4\",\n 300: \"#5eead4\",\n 400: \"#2dd4bf\",\n 500: \"#14b8a6\",\n 600: \"#0d9488\",\n 700: \"#0f766e\",\n 800: \"#115e59\",\n 900: \"#134e4a\",\n 950: \"#042f2e\"\n },\n cyan: {\n 50: \"#ecfeff\",\n 100: \"#cffafe\",\n 200: \"#a5f3fc\",\n 300: \"#67e8f9\",\n 400: \"#22d3ee\",\n 500: \"#06b6d4\",\n 600: \"#0891b2\",\n 700: \"#0e7490\",\n 800: \"#155e75\",\n 900: \"#164e63\",\n 950: \"#083344\"\n },\n sky: {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n 950: \"#082f49\"\n },\n blue: {\n 50: \"#eff6ff\",\n 100: \"#dbeafe\",\n 200: \"#bfdbfe\",\n 300: \"#93c5fd\",\n 400: \"#60a5fa\",\n 500: \"#3b82f6\",\n 600: \"#2563eb\",\n 700: \"#1d4ed8\",\n 800: \"#1e40af\",\n 900: \"#1e3a8a\",\n 950: \"#172554\"\n },\n indigo: {\n 50: \"#eef2ff\",\n 100: \"#e0e7ff\",\n 200: \"#c7d2fe\",\n 300: \"#a5b4fc\",\n 400: \"#818cf8\",\n 500: \"#6366f1\",\n 600: \"#4f46e5\",\n 700: \"#4338ca\",\n 800: \"#3730a3\",\n 900: \"#312e81\",\n 950: \"#1e1b4b\"\n },\n violet: {\n 50: \"#f5f3ff\",\n 100: \"#ede9fe\",\n 200: \"#ddd6fe\",\n 300: \"#c4b5fd\",\n 400: \"#a78bfa\",\n 500: \"#8b5cf6\",\n 600: \"#7c3aed\",\n 700: \"#6d28d9\",\n 800: \"#5b21b6\",\n 900: \"#4c1d95\",\n 950: \"#2e1065\"\n },\n purple: {\n 50: \"#faf5ff\",\n 100: \"#f3e8ff\",\n 200: \"#e9d5ff\",\n 300: \"#d8b4fe\",\n 400: \"#c084fc\",\n 500: \"#a855f7\",\n 600: \"#9333ea\",\n 700: \"#7e22ce\",\n 800: \"#6b21a8\",\n 900: \"#581c87\",\n 950: \"#3b0764\"\n },\n fuchsia: {\n 50: \"#fdf4ff\",\n 100: \"#fae8ff\",\n 200: \"#f5d0fe\",\n 300: \"#f0abfc\",\n 400: \"#e879f9\",\n 500: \"#d946ef\",\n 600: \"#c026d3\",\n 700: \"#a21caf\",\n 800: \"#86198f\",\n 900: \"#701a75\",\n 950: \"#4a044e\"\n },\n pink: {\n 50: \"#fdf2f8\",\n 100: \"#fce7f3\",\n 200: \"#fbcfe8\",\n 300: \"#f9a8d4\",\n 400: \"#f472b6\",\n 500: \"#ec4899\",\n 600: \"#db2777\",\n 700: \"#be185d\",\n 800: \"#9d174d\",\n 900: \"#831843\",\n 950: \"#500724\"\n },\n rose: {\n 50: \"#fff1f2\",\n 100: \"#ffe4e6\",\n 200: \"#fecdd3\",\n 300: \"#fda4af\",\n 400: \"#fb7185\",\n 500: \"#f43f5e\",\n 600: \"#e11d48\",\n 700: \"#be123c\",\n 800: \"#9f1239\",\n 900: \"#881337\",\n 950: \"#4c0519\"\n },\n get lightBlue () {\n warn({\n version: \"v2.2\",\n from: \"lightBlue\",\n to: \"sky\"\n });\n return this.sky;\n },\n get warmGray () {\n warn({\n version: \"v3.0\",\n from: \"warmGray\",\n to: \"stone\"\n });\n return this.stone;\n },\n get trueGray () {\n warn({\n version: \"v3.0\",\n from: \"trueGray\",\n to: \"neutral\"\n });\n return this.neutral;\n },\n get coolGray () {\n warn({\n version: \"v3.0\",\n from: \"coolGray\",\n to: \"gray\"\n });\n return this.gray;\n },\n get blueGray () {\n warn({\n version: \"v3.0\",\n from: \"blueGray\",\n to: \"slate\"\n });\n return this.slate;\n }\n};\n","let colors = require('./lib/public/colors')\nmodule.exports = (colors.__esModule ? colors : { default: colors }).default\n","import chroma, { InterpolationMode } from 'chroma-js';\n\nimport { DefaultColors } from 'tailwindcss/types/generated/colors.d.js';\nimport builtInColors from 'tailwindcss/colors.js';\n\nfunction keys(obj: T): (keyof T)[] {\n return Object.keys(obj) as (keyof T)[];\n}\n\nfunction entries(obj: T): [keyof T, T[keyof T]][] {\n return Object.entries(obj) as [keyof T, T[keyof T]][];\n}\n\nfunction hasOwn(obj: T, key: keyof T): key is keyof T {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n// valid color modes for chroma-js\nexport const validColorModes = [\n 'rgb',\n 'lab',\n 'lch',\n 'lrgb',\n 'hcl',\n 'num',\n 'hcg',\n 'oklch',\n 'hsi',\n 'hsl',\n 'hsv',\n 'oklab',\n] as const;\n\n// types for tailwind-lerp-colors\ntype Shades = Exclude | DefaultColors[keyof DefaultColors], string>;\ntype Colors = Record | DefaultColors;\ntype ColorMode = (typeof validColorModes)[number];\ntype Options = {\n includeBase?: boolean;\n includeLegacy?: boolean;\n lerpEnds?: boolean;\n interval?: number;\n mode?: ColorMode;\n};\ntype OptionName = keyof Options;\ntype Option = Options[T];\ntype SingularOptions = Pick;\n\n// default options for tailwind-lerp-colors -> lerpColor\nconst defaultSingleOptions: Required = {\n lerpEnds: true,\n interval: 25,\n mode: 'lrgb',\n};\n\n// default options for tailwind-lerp-colors -> lerpColors\nconst defaultOptions = {\n includeBase: true,\n includeLegacy: false,\n ...defaultSingleOptions,\n};\n\nconst isOptionInvalid = (options: Options, optionName: T, test: (k: Option) => boolean) => {\n return options && hasOwn(options, optionName) && !test(options[optionName]);\n};\n\nconst throwError = (message: string) => {\n throw new Error(message);\n};\n\nconst isValidShade = (shades: Shades | string): shades is Shades => {\n if (\n // undefined or null\n shades == null ||\n // check if shades is an object\n typeof shades !== 'object' ||\n // check if shades is an array\n Array.isArray(shades) ||\n shades.toString() !== '[object Object]' ||\n !keys(shades).some((key) => !isNaN(+key) && +key >= 0 && +key <= 1000)\n ) {\n return false;\n }\n return true;\n};\n\nexport const lerpColor = (shades: Shades, options: SingularOptions = {}) => {\n // validate lerpEnds\n if (isOptionInvalid(options, 'lerpEnds', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `lerpEnds` must be a boolean.');\n\n // validate interval\n if (isOptionInvalid(options, 'interval', (v) => Number.isInteger(v) && typeof v === 'number' && v > 0))\n throwError('tailwind-lerp-colors option `interval` must be a positive integer greater than 0.');\n\n // validate mode\n if (isOptionInvalid(options, 'mode', (v) => typeof v === 'string' && validColorModes.includes(v)))\n throwError(\n `tailwind-lerp-colors option \\`mode\\` must be one of the following values: ${validColorModes.join(', ')}.`\n );\n\n if (!isValidShade(shades))\n throwError(\n `tailwind-lerp-colors object \\`shades\\` must be an object with numeric keys.\\n\\nvalue used: ${JSON.stringify(\n shades,\n null,\n 2\n )}`\n );\n const { lerpEnds, interval, mode } = {\n ...defaultSingleOptions,\n ...(options ?? {}),\n };\n\n const sortByNumericFirstIndex = ([numericKeyA]: [number, string], [numericKeyB]: [number, string]) => {\n return numericKeyA - numericKeyB;\n };\n\n const namedShades: Record = {};\n const numericShades = entries(shades)\n .flatMap(([key, color]) => {\n const numericShade = +key;\n if (isNaN(numericShade)) {\n namedShades[key] = color;\n return [];\n }\n return [[numericShade, color]] as [[number, string]];\n })\n .sort(sortByNumericFirstIndex);\n\n if (lerpEnds) {\n if (numericShades[0]?.[0] !== 0) numericShades.unshift([0, '#ffffff']);\n if (numericShades.slice(-1)[0]?.[0] !== 1000) numericShades.push([1000, '#000000']);\n }\n const finalShades = [...numericShades];\n for (let i = 0; i < numericShades.length - 1; i++) {\n const [shade, color] = numericShades[i] ?? [];\n const [nextShade, nextColor] = numericShades[i + 1] ?? [];\n if (!shade || !color || !nextShade || !nextColor) {\n continue;\n }\n\n // check to make sure both shades being compared\n // are evenly divisible by the set interval\n const interpolations = (nextShade - shade) / interval - 1;\n if (interpolations <= 0 || !Number.isInteger(interpolations)) continue;\n\n const scale = chroma.scale([color, nextColor]).mode(mode as InterpolationMode);\n const getColorAt = (percent: number) => scale(percent).hex();\n for (let run = 1; run <= interpolations; run++) {\n const percent = run / (interpolations + 1);\n finalShades.push([shade + interval * run, getColorAt(percent)]);\n }\n }\n finalShades.sort(sortByNumericFirstIndex);\n\n return {\n ...Object.fromEntries(finalShades),\n ...namedShades,\n };\n};\n\nexport const lerpColors = (colorsObj: Colors = {}, options: Options = {}) => {\n // validate includeBase\n if (isOptionInvalid(options, 'includeBase', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeBase` must be a boolean.');\n\n // validate includeLegacy\n if (isOptionInvalid(options, 'includeLegacy', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeLegacy` must be a boolean.');\n\n const legacyNames = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray'];\n\n const { includeBase, includeLegacy, lerpEnds, interval, mode } = {\n ...defaultOptions,\n ...options,\n };\n const baseColors: Colors = {};\n if (includeBase) {\n const builtInColorKeys = keys(builtInColors);\n for (const key of builtInColorKeys) {\n if (!legacyNames.includes(key) || includeLegacy) {\n baseColors[key] = builtInColors[key];\n }\n }\n }\n\n const initialColors = entries({\n ...baseColors,\n ...colorsObj,\n });\n\n const finalColors: Colors = {};\n\n for (const [name, shades] of initialColors) {\n if (!isValidShade(shades)) {\n finalColors[name] = shades;\n } else {\n finalColors[name] = lerpColor(shades, { lerpEnds, interval, mode });\n }\n }\n\n return finalColors;\n};\n\nexport type {\n Shades as LerpColorsShades,\n Colors as LerpColorsColors,\n ColorMode as LerpColorsColorMode,\n Options as LerpColorsOptions,\n OptionName as LerpColorsOptionName,\n Option as LerpColorsOption,\n SingularOptions as LerpColorsSingularOptions,\n};\n"],"names":["x","String","create","isColorSupported","reset","bold","dim","italic","underline","inverse","hidden","strikethrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","picocolors_browser","Object","defineProperty","exports","value","target","all","name","enumerable","get","_export","default","_default","_picocolors","_interop_require_default","require$$0","obj","__esModule","alreadyShown","Set","log","type","messages","key","process","env","JEST_WORKER_ID","has","add","console","warn","forEach","message","input","info","Array","isArray","risk","_log","version","from","to","inherit","current","transparent","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","sky","indigo","violet","purple","fuchsia","pink","rose","lightBlue","this","warmGray","trueGray","coolGray","blueGray","colors_1","colors","keys","entries","validColorModes","defaultSingleOptions","lerpEnds","interval","mode","defaultOptions","_extends","includeBase","includeLegacy","isOptionInvalid","options","optionName","test","prototype","hasOwnProperty","call","throwError","Error","isValidShade","shades","toString","some","isNaN","lerpColor","_options","v","Number","isInteger","includes","join","JSON","stringify","_numericShades$","_numericShades$slice$","_defaultSingleOptions","sortByNumericFirstIndex","_ref","_ref2","namedShades","numericShades","flatMap","_ref3","color","numericShade","sort","unshift","slice","push","finalShades","concat","_loop","_numericShades$i","_numericShades","_ref4","i","shade","_ref5","nextShade","nextColor","percent","interpolations","scale","chroma","run","hex","length","fromEntries","lerpColors","colorsObj","legacyNames","_defaultOptions$optio","baseColors","_step","_iterator","_createForOfIteratorHelperLoose","builtInColors","done","_step2","finalColors","_iterator2","_step2$value"],"mappings":"onCAAA,IAAIA,EAAEC,OACFC,EAAO,WAAY,MAAO,CAACC,kBAAiB,EAAMC,MAAMJ,EAAEK,KAAKL,EAAEM,IAAIN,EAAEO,OAAOP,EAAEQ,UAAUR,EAAES,QAAQT,EAAEU,OAAOV,EAAEW,cAAcX,EAAEY,MAAMZ,EAAEa,IAAIb,EAAEc,MAAMd,EAAEe,OAAOf,EAAEgB,KAAKhB,EAAEiB,QAAQjB,EAAEkB,KAAKlB,EAAEmB,MAAMnB,EAAEoB,KAAKpB,EAAEqB,QAAQrB,EAAEsB,MAAMtB,EAAEuB,QAAQvB,EAAEwB,SAASxB,EAAEyB,OAAOzB,EAAE0B,UAAU1B,EAAE2B,OAAO3B,EAAE4B,QAAQ5B,EAAE,EAC1Q6B,EAAC3B,mBACeA,4BCF9B4B,OAAOC,eAAwBC,EAAA,aAAc,CACzCC,OAAO,IAEX,SAAiBC,EAAQC,GACrB,IAAI,IAAIC,KAAQD,EAAIL,OAAOC,eAAeG,EAAQE,EAAM,CACpDC,YAAY,EACZC,IAAKH,EAAIC,IAEjB,CACAG,CAAQP,EAAS,CACb1B,IAAK,WACD,OAAOA,CACV,EACDkC,QAAS,WACL,OAAOC,CACV,IAEL,MAAMC,eAA4BC,EAAyBC,GAC3D,SAASD,EAAyBE,GAC9B,OAAOA,GAAOA,EAAIC,WAAaD,EAAM,CACjCL,QAASK,EAEjB,CACA,IAAIE,EAAe,IAAIC,IACvB,SAASC,EAAIC,EAAMC,EAAUC,GACF,oBAAZC,SAA2BA,QAAQC,IAAIC,gBAC9CH,GAAOL,EAAaS,IAAIJ,KACxBA,GAAKL,EAAaU,IAAIL,GAC1BM,QAAQC,KAAK,IACbR,EAASS,QAASC,GAAUH,QAAQC,KAAKT,EAAM,IAAKW,IACxD,CACA,SAASvD,EAAIwD,GACT,OAAOpB,EAAYF,QAAQlC,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E,KAIlDmE,EAAqB,CAAE,EAC7B,GALmBD,EAAX/D,YAON,IADA,IACkCiE,EAAlCC,EAAAC,EADyB5E,EAAK6E,MACIH,EAAAC,KAAAG,MAAE,CAAzB,IAAA5H,EAAGwH,EAAA3I,MACPwI,EAAYzC,SAAS5E,KAAQwD,IAChC+D,EAAWvH,GAAO2H,EAAc3H,GAEnC,CAUH,IAPA,IAO0C6H,EAFpCC,EAAsB,CAAA,EAE5BC,EAAAL,EAPsB3E,EAAOO,EACxBiE,CAAAA,EAAAA,EACAH,OAKqCS,EAAAE,KAAAH,MAAE,CAAA,IAAAI,EAAAH,EAAAhJ,MAA1BsF,EAAM6D,KAIpBF,EAJYE,EAAE7D,IACXD,EAAaC,GAGII,EAAUJ,EAAQ,CAAEjB,SAAAA,EAAUC,SAAAA,EAAUC,KAAAA,IAFxCe,CAIvB,CAED,OAAO2D,CACT"} -------------------------------------------------------------------------------- /dist/index.umd.js: -------------------------------------------------------------------------------- 1 | !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("chroma-js")):"function"==typeof define&&define.amd?define(["exports","chroma-js"],r):r((e||self).tailwindcssLerpColors={},e.chromaJs)}(this,function(e,r){function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/f(r);function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;re.length)&&(r=e.length);for(var f=0,n=new Array(r);f=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e){var r={exports:{}};return e(r,r.exports),r.exports}var c=String,l=function(){return{isColorSupported:!1,reset:c,bold:c,dim:c,italic:c,underline:c,inverse:c,hidden:c,strikethrough:c,black:c,red:c,green:c,yellow:c,blue:c,magenta:c,cyan:c,white:c,gray:c,bgBlack:c,bgRed:c,bgGreen:c,bgYellow:c,bgBlue:c,bgMagenta:c,bgCyan:c,bgWhite:c}},d=l();d.createColors=l;var u=d,s=i(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),function(e,r){for(var f in r)Object.defineProperty(e,f,{enumerable:!0,get:r[f]})}(r,{dim:function(){return o},default:function(){return i}});const f=/*#__PURE__*/n(u);function n(e){return e&&e.__esModule?e:{default:e}}let t=new Set;function a(e,r,f){"undefined"!=typeof process&&process.env.JEST_WORKER_ID||f&&t.has(f)||(f&&t.add(f),console.warn(""),r.forEach(r=>console.warn(e,"-",r)))}function o(e){return f.default.dim(e)}const i={info(e,r){a(f.default.bold(f.default.cyan("info")),...Array.isArray(e)?[e]:[r,e])},warn(e,r){a(f.default.bold(f.default.yellow("warn")),...Array.isArray(e)?[e]:[r,e])},risk(e,r){a(f.default.bold(f.default.magenta("risk")),...Array.isArray(e)?[e]:[r,e])}}}),b=i(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});const f=/*#__PURE__*/n(s);function n(e){return e&&e.__esModule?e:{default:e}}function t({version:e,from:r,to:n}){f.default.warn(`${r}-color-renamed`,[`As of Tailwind CSS ${e}, \`${r}\` has been renamed to \`${n}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return t({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return t({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return t({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return t({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return t({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}),y=(b.__esModule?b:{default:b}).default;function p(e){return Object.keys(e)}function v(e){return Object.entries(e)}var g=["rgb","lab","lch","lrgb","hcl","num","hcg","oklch","hsi","hsl","hsv","oklab"],m={lerpEnds:!0,interval:25,mode:"lrgb"},h=t({includeBase:!0,includeLegacy:!1},m),w=function(e,r,f){return e&&Object.prototype.hasOwnProperty.call(e,r)&&!f(e[r])},j=function(e){throw new Error(e)},O=function(e){return!(null==e||"object"!=typeof e||Array.isArray(e)||"[object Object]"!==e.toString()||!p(e).some(function(e){return!isNaN(+e)&&+e>=0&&+e<=1e3}))},A=function(e,r){var f;void 0===r&&(r={}),w(r,"lerpEnds",function(e){return"boolean"==typeof e})&&j("tailwind-lerp-colors option `lerpEnds` must be a boolean."),w(r,"interval",function(e){return Number.isInteger(e)&&"number"==typeof e&&e>0})&&j("tailwind-lerp-colors option `interval` must be a positive integer greater than 0."),w(r,"mode",function(e){return"string"==typeof e&&g.includes(e)})&&j("tailwind-lerp-colors option `mode` must be one of the following values: "+g.join(", ")+"."),O(e)||j("tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: "+JSON.stringify(e,null,2));var a,o,i=t({},m,null!=(f=r)?f:{}),c=i.lerpEnds,l=i.interval,d=i.mode,u=function(e,r){return e[0]-r[0]},s={},b=v(e).flatMap(function(e){var r=e[0],f=e[1],n=+r;return isNaN(n)?(s[r]=f,[]):[[n,f]]}).sort(u);c&&(0!==(null==(a=b[0])?void 0:a[0])&&b.unshift([0,"#ffffff"]),1e3!==(null==(o=b.slice(-1)[0])?void 0:o[0])&&b.push([1e3,"#000000"]));for(var y=[].concat(b),p=function(){var e,r,f=null!=(e=b[h])?e:[],t=f[0],a=f[1],o=null!=(r=b[h+1])?r:[],i=o[0],c=o[1];if(!(t&&a&&i&&c))return 0;var u,s=(i-t)/l-1;if(s<=0||!Number.isInteger(s))return 0;for(var p=n.default.scale([a,c]).mode(d),v=1;v<=s;v++)y.push([t+l*v,(u=v/(s+1),p(u).hex())])},h=0;hconsole.warn(type, \"-\", message));\n}\nfunction dim(input) {\n return _picocolors.default.dim(input);\n}\nconst _default = {\n info (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.cyan(\"info\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n warn (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.yellow(\"warn\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n },\n risk (key, messages) {\n log(_picocolors.default.bold(_picocolors.default.magenta(\"risk\")), ...Array.isArray(key) ? [\n key\n ] : [\n messages,\n key\n ]);\n }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _log = /*#__PURE__*/ _interop_require_default(require(\"../util/log\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction warn({ version , from , to }) {\n _log.default.warn(`${from}-color-renamed`, [\n `As of Tailwind CSS ${version}, \\`${from}\\` has been renamed to \\`${to}\\`.`,\n \"Update your configuration file to silence this warning.\"\n ]);\n}\nconst _default = {\n inherit: \"inherit\",\n current: \"currentColor\",\n transparent: \"transparent\",\n black: \"#000\",\n white: \"#fff\",\n slate: {\n 50: \"#f8fafc\",\n 100: \"#f1f5f9\",\n 200: \"#e2e8f0\",\n 300: \"#cbd5e1\",\n 400: \"#94a3b8\",\n 500: \"#64748b\",\n 600: \"#475569\",\n 700: \"#334155\",\n 800: \"#1e293b\",\n 900: \"#0f172a\",\n 950: \"#020617\"\n },\n gray: {\n 50: \"#f9fafb\",\n 100: \"#f3f4f6\",\n 200: \"#e5e7eb\",\n 300: \"#d1d5db\",\n 400: \"#9ca3af\",\n 500: \"#6b7280\",\n 600: \"#4b5563\",\n 700: \"#374151\",\n 800: \"#1f2937\",\n 900: \"#111827\",\n 950: \"#030712\"\n },\n zinc: {\n 50: \"#fafafa\",\n 100: \"#f4f4f5\",\n 200: \"#e4e4e7\",\n 300: \"#d4d4d8\",\n 400: \"#a1a1aa\",\n 500: \"#71717a\",\n 600: \"#52525b\",\n 700: \"#3f3f46\",\n 800: \"#27272a\",\n 900: \"#18181b\",\n 950: \"#09090b\"\n },\n neutral: {\n 50: \"#fafafa\",\n 100: \"#f5f5f5\",\n 200: \"#e5e5e5\",\n 300: \"#d4d4d4\",\n 400: \"#a3a3a3\",\n 500: \"#737373\",\n 600: \"#525252\",\n 700: \"#404040\",\n 800: \"#262626\",\n 900: \"#171717\",\n 950: \"#0a0a0a\"\n },\n stone: {\n 50: \"#fafaf9\",\n 100: \"#f5f5f4\",\n 200: \"#e7e5e4\",\n 300: \"#d6d3d1\",\n 400: \"#a8a29e\",\n 500: \"#78716c\",\n 600: \"#57534e\",\n 700: \"#44403c\",\n 800: \"#292524\",\n 900: \"#1c1917\",\n 950: \"#0c0a09\"\n },\n red: {\n 50: \"#fef2f2\",\n 100: \"#fee2e2\",\n 200: \"#fecaca\",\n 300: \"#fca5a5\",\n 400: \"#f87171\",\n 500: \"#ef4444\",\n 600: \"#dc2626\",\n 700: \"#b91c1c\",\n 800: \"#991b1b\",\n 900: \"#7f1d1d\",\n 950: \"#450a0a\"\n },\n orange: {\n 50: \"#fff7ed\",\n 100: \"#ffedd5\",\n 200: \"#fed7aa\",\n 300: \"#fdba74\",\n 400: \"#fb923c\",\n 500: \"#f97316\",\n 600: \"#ea580c\",\n 700: \"#c2410c\",\n 800: \"#9a3412\",\n 900: \"#7c2d12\",\n 950: \"#431407\"\n },\n amber: {\n 50: \"#fffbeb\",\n 100: \"#fef3c7\",\n 200: \"#fde68a\",\n 300: \"#fcd34d\",\n 400: \"#fbbf24\",\n 500: \"#f59e0b\",\n 600: \"#d97706\",\n 700: \"#b45309\",\n 800: \"#92400e\",\n 900: \"#78350f\",\n 950: \"#451a03\"\n },\n yellow: {\n 50: \"#fefce8\",\n 100: \"#fef9c3\",\n 200: \"#fef08a\",\n 300: \"#fde047\",\n 400: \"#facc15\",\n 500: \"#eab308\",\n 600: \"#ca8a04\",\n 700: \"#a16207\",\n 800: \"#854d0e\",\n 900: \"#713f12\",\n 950: \"#422006\"\n },\n lime: {\n 50: \"#f7fee7\",\n 100: \"#ecfccb\",\n 200: \"#d9f99d\",\n 300: \"#bef264\",\n 400: \"#a3e635\",\n 500: \"#84cc16\",\n 600: \"#65a30d\",\n 700: \"#4d7c0f\",\n 800: \"#3f6212\",\n 900: \"#365314\",\n 950: \"#1a2e05\"\n },\n green: {\n 50: \"#f0fdf4\",\n 100: \"#dcfce7\",\n 200: \"#bbf7d0\",\n 300: \"#86efac\",\n 400: \"#4ade80\",\n 500: \"#22c55e\",\n 600: \"#16a34a\",\n 700: \"#15803d\",\n 800: \"#166534\",\n 900: \"#14532d\",\n 950: \"#052e16\"\n },\n emerald: {\n 50: \"#ecfdf5\",\n 100: \"#d1fae5\",\n 200: \"#a7f3d0\",\n 300: \"#6ee7b7\",\n 400: \"#34d399\",\n 500: \"#10b981\",\n 600: \"#059669\",\n 700: \"#047857\",\n 800: \"#065f46\",\n 900: \"#064e3b\",\n 950: \"#022c22\"\n },\n teal: {\n 50: \"#f0fdfa\",\n 100: \"#ccfbf1\",\n 200: \"#99f6e4\",\n 300: \"#5eead4\",\n 400: \"#2dd4bf\",\n 500: \"#14b8a6\",\n 600: \"#0d9488\",\n 700: \"#0f766e\",\n 800: \"#115e59\",\n 900: \"#134e4a\",\n 950: \"#042f2e\"\n },\n cyan: {\n 50: \"#ecfeff\",\n 100: \"#cffafe\",\n 200: \"#a5f3fc\",\n 300: \"#67e8f9\",\n 400: \"#22d3ee\",\n 500: \"#06b6d4\",\n 600: \"#0891b2\",\n 700: \"#0e7490\",\n 800: \"#155e75\",\n 900: \"#164e63\",\n 950: \"#083344\"\n },\n sky: {\n 50: \"#f0f9ff\",\n 100: \"#e0f2fe\",\n 200: \"#bae6fd\",\n 300: \"#7dd3fc\",\n 400: \"#38bdf8\",\n 500: \"#0ea5e9\",\n 600: \"#0284c7\",\n 700: \"#0369a1\",\n 800: \"#075985\",\n 900: \"#0c4a6e\",\n 950: \"#082f49\"\n },\n blue: {\n 50: \"#eff6ff\",\n 100: \"#dbeafe\",\n 200: \"#bfdbfe\",\n 300: \"#93c5fd\",\n 400: \"#60a5fa\",\n 500: \"#3b82f6\",\n 600: \"#2563eb\",\n 700: \"#1d4ed8\",\n 800: \"#1e40af\",\n 900: \"#1e3a8a\",\n 950: \"#172554\"\n },\n indigo: {\n 50: \"#eef2ff\",\n 100: \"#e0e7ff\",\n 200: \"#c7d2fe\",\n 300: \"#a5b4fc\",\n 400: \"#818cf8\",\n 500: \"#6366f1\",\n 600: \"#4f46e5\",\n 700: \"#4338ca\",\n 800: \"#3730a3\",\n 900: \"#312e81\",\n 950: \"#1e1b4b\"\n },\n violet: {\n 50: \"#f5f3ff\",\n 100: \"#ede9fe\",\n 200: \"#ddd6fe\",\n 300: \"#c4b5fd\",\n 400: \"#a78bfa\",\n 500: \"#8b5cf6\",\n 600: \"#7c3aed\",\n 700: \"#6d28d9\",\n 800: \"#5b21b6\",\n 900: \"#4c1d95\",\n 950: \"#2e1065\"\n },\n purple: {\n 50: \"#faf5ff\",\n 100: \"#f3e8ff\",\n 200: \"#e9d5ff\",\n 300: \"#d8b4fe\",\n 400: \"#c084fc\",\n 500: \"#a855f7\",\n 600: \"#9333ea\",\n 700: \"#7e22ce\",\n 800: \"#6b21a8\",\n 900: \"#581c87\",\n 950: \"#3b0764\"\n },\n fuchsia: {\n 50: \"#fdf4ff\",\n 100: \"#fae8ff\",\n 200: \"#f5d0fe\",\n 300: \"#f0abfc\",\n 400: \"#e879f9\",\n 500: \"#d946ef\",\n 600: \"#c026d3\",\n 700: \"#a21caf\",\n 800: \"#86198f\",\n 900: \"#701a75\",\n 950: \"#4a044e\"\n },\n pink: {\n 50: \"#fdf2f8\",\n 100: \"#fce7f3\",\n 200: \"#fbcfe8\",\n 300: \"#f9a8d4\",\n 400: \"#f472b6\",\n 500: \"#ec4899\",\n 600: \"#db2777\",\n 700: \"#be185d\",\n 800: \"#9d174d\",\n 900: \"#831843\",\n 950: \"#500724\"\n },\n rose: {\n 50: \"#fff1f2\",\n 100: \"#ffe4e6\",\n 200: \"#fecdd3\",\n 300: \"#fda4af\",\n 400: \"#fb7185\",\n 500: \"#f43f5e\",\n 600: \"#e11d48\",\n 700: \"#be123c\",\n 800: \"#9f1239\",\n 900: \"#881337\",\n 950: \"#4c0519\"\n },\n get lightBlue () {\n warn({\n version: \"v2.2\",\n from: \"lightBlue\",\n to: \"sky\"\n });\n return this.sky;\n },\n get warmGray () {\n warn({\n version: \"v3.0\",\n from: \"warmGray\",\n to: \"stone\"\n });\n return this.stone;\n },\n get trueGray () {\n warn({\n version: \"v3.0\",\n from: \"trueGray\",\n to: \"neutral\"\n });\n return this.neutral;\n },\n get coolGray () {\n warn({\n version: \"v3.0\",\n from: \"coolGray\",\n to: \"gray\"\n });\n return this.gray;\n },\n get blueGray () {\n warn({\n version: \"v3.0\",\n from: \"blueGray\",\n to: \"slate\"\n });\n return this.slate;\n }\n};\n","let colors = require('./lib/public/colors')\nmodule.exports = (colors.__esModule ? colors : { default: colors }).default\n","import chroma, { InterpolationMode } from 'chroma-js';\n\nimport { DefaultColors } from 'tailwindcss/types/generated/colors.d.js';\nimport builtInColors from 'tailwindcss/colors.js';\n\nfunction keys(obj: T): (keyof T)[] {\n return Object.keys(obj) as (keyof T)[];\n}\n\nfunction entries(obj: T): [keyof T, T[keyof T]][] {\n return Object.entries(obj) as [keyof T, T[keyof T]][];\n}\n\nfunction hasOwn(obj: T, key: keyof T): key is keyof T {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\n// valid color modes for chroma-js\nexport const validColorModes = [\n 'rgb',\n 'lab',\n 'lch',\n 'lrgb',\n 'hcl',\n 'num',\n 'hcg',\n 'oklch',\n 'hsi',\n 'hsl',\n 'hsv',\n 'oklab',\n] as const;\n\n// types for tailwind-lerp-colors\ntype Shades = Exclude | DefaultColors[keyof DefaultColors], string>;\ntype Colors = Record | DefaultColors;\ntype ColorMode = (typeof validColorModes)[number];\ntype Options = {\n includeBase?: boolean;\n includeLegacy?: boolean;\n lerpEnds?: boolean;\n interval?: number;\n mode?: ColorMode;\n};\ntype OptionName = keyof Options;\ntype Option = Options[T];\ntype SingularOptions = Pick;\n\n// default options for tailwind-lerp-colors -> lerpColor\nconst defaultSingleOptions: Required = {\n lerpEnds: true,\n interval: 25,\n mode: 'lrgb',\n};\n\n// default options for tailwind-lerp-colors -> lerpColors\nconst defaultOptions = {\n includeBase: true,\n includeLegacy: false,\n ...defaultSingleOptions,\n};\n\nconst isOptionInvalid = (options: Options, optionName: T, test: (k: Option) => boolean) => {\n return options && hasOwn(options, optionName) && !test(options[optionName]);\n};\n\nconst throwError = (message: string) => {\n throw new Error(message);\n};\n\nconst isValidShade = (shades: Shades | string): shades is Shades => {\n if (\n // undefined or null\n shades == null ||\n // check if shades is an object\n typeof shades !== 'object' ||\n // check if shades is an array\n Array.isArray(shades) ||\n shades.toString() !== '[object Object]' ||\n !keys(shades).some((key) => !isNaN(+key) && +key >= 0 && +key <= 1000)\n ) {\n return false;\n }\n return true;\n};\n\nexport const lerpColor = (shades: Shades, options: SingularOptions = {}) => {\n // validate lerpEnds\n if (isOptionInvalid(options, 'lerpEnds', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `lerpEnds` must be a boolean.');\n\n // validate interval\n if (isOptionInvalid(options, 'interval', (v) => Number.isInteger(v) && typeof v === 'number' && v > 0))\n throwError('tailwind-lerp-colors option `interval` must be a positive integer greater than 0.');\n\n // validate mode\n if (isOptionInvalid(options, 'mode', (v) => typeof v === 'string' && validColorModes.includes(v)))\n throwError(\n `tailwind-lerp-colors option \\`mode\\` must be one of the following values: ${validColorModes.join(', ')}.`\n );\n\n if (!isValidShade(shades))\n throwError(\n `tailwind-lerp-colors object \\`shades\\` must be an object with numeric keys.\\n\\nvalue used: ${JSON.stringify(\n shades,\n null,\n 2\n )}`\n );\n const { lerpEnds, interval, mode } = {\n ...defaultSingleOptions,\n ...(options ?? {}),\n };\n\n const sortByNumericFirstIndex = ([numericKeyA]: [number, string], [numericKeyB]: [number, string]) => {\n return numericKeyA - numericKeyB;\n };\n\n const namedShades: Record = {};\n const numericShades = entries(shades)\n .flatMap(([key, color]) => {\n const numericShade = +key;\n if (isNaN(numericShade)) {\n namedShades[key] = color;\n return [];\n }\n return [[numericShade, color]] as [[number, string]];\n })\n .sort(sortByNumericFirstIndex);\n\n if (lerpEnds) {\n if (numericShades[0]?.[0] !== 0) numericShades.unshift([0, '#ffffff']);\n if (numericShades.slice(-1)[0]?.[0] !== 1000) numericShades.push([1000, '#000000']);\n }\n const finalShades = [...numericShades];\n for (let i = 0; i < numericShades.length - 1; i++) {\n const [shade, color] = numericShades[i] ?? [];\n const [nextShade, nextColor] = numericShades[i + 1] ?? [];\n if (!shade || !color || !nextShade || !nextColor) {\n continue;\n }\n\n // check to make sure both shades being compared\n // are evenly divisible by the set interval\n const interpolations = (nextShade - shade) / interval - 1;\n if (interpolations <= 0 || !Number.isInteger(interpolations)) continue;\n\n const scale = chroma.scale([color, nextColor]).mode(mode as InterpolationMode);\n const getColorAt = (percent: number) => scale(percent).hex();\n for (let run = 1; run <= interpolations; run++) {\n const percent = run / (interpolations + 1);\n finalShades.push([shade + interval * run, getColorAt(percent)]);\n }\n }\n finalShades.sort(sortByNumericFirstIndex);\n\n return {\n ...Object.fromEntries(finalShades),\n ...namedShades,\n };\n};\n\nexport const lerpColors = (colorsObj: Colors = {}, options: Options = {}) => {\n // validate includeBase\n if (isOptionInvalid(options, 'includeBase', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeBase` must be a boolean.');\n\n // validate includeLegacy\n if (isOptionInvalid(options, 'includeLegacy', (v) => typeof v === 'boolean'))\n throwError('tailwind-lerp-colors option `includeLegacy` must be a boolean.');\n\n const legacyNames = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray'];\n\n const { includeBase, includeLegacy, lerpEnds, interval, mode } = {\n ...defaultOptions,\n ...options,\n };\n const baseColors: Colors = {};\n if (includeBase) {\n const builtInColorKeys = keys(builtInColors);\n for (const key of builtInColorKeys) {\n if (!legacyNames.includes(key) || includeLegacy) {\n baseColors[key] = builtInColors[key];\n }\n }\n }\n\n const initialColors = entries({\n ...baseColors,\n ...colorsObj,\n });\n\n const finalColors: Colors = {};\n\n for (const [name, shades] of initialColors) {\n if (!isValidShade(shades)) {\n finalColors[name] = shades;\n } else {\n finalColors[name] = lerpColor(shades, { lerpEnds, interval, mode });\n }\n }\n\n return finalColors;\n};\n\nexport type {\n Shades as LerpColorsShades,\n Colors as LerpColorsColors,\n ColorMode as LerpColorsColorMode,\n Options as LerpColorsOptions,\n OptionName as LerpColorsOptionName,\n Option as LerpColorsOption,\n SingularOptions as LerpColorsSingularOptions,\n};\n"],"names":["x","String","create","isColorSupported","reset","bold","dim","italic","underline","inverse","hidden","strikethrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","picocolors_browser","Object","defineProperty","exports","value","target","all","name","enumerable","get","_export","default","_default","_picocolors","_interop_require_default","require$$0","obj","__esModule","alreadyShown","Set","log","type","messages","key","process","env","JEST_WORKER_ID","has","add","console","warn","forEach","message","input","info","Array","isArray","risk","_log","version","from","to","inherit","current","transparent","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","sky","indigo","violet","purple","fuchsia","pink","rose","lightBlue","this","warmGray","trueGray","coolGray","blueGray","colors_1","colors","keys","entries","validColorModes","defaultSingleOptions","lerpEnds","interval","mode","defaultOptions","_extends","includeBase","includeLegacy","isOptionInvalid","options","optionName","test","prototype","hasOwnProperty","call","throwError","Error","isValidShade","shades","toString","some","isNaN","lerpColor","_options","v","Number","isInteger","includes","join","JSON","stringify","_numericShades$","_numericShades$slice$","_defaultSingleOptions","sortByNumericFirstIndex","_ref","_ref2","namedShades","numericShades","flatMap","_ref3","color","numericShade","sort","unshift","slice","push","finalShades","concat","_loop","_numericShades$i","_numericShades","_ref4","i","shade","_ref5","nextShade","nextColor","percent","interpolations","scale","chroma","run","hex","length","fromEntries","colorsObj","legacyNames","_defaultOptions$optio","baseColors","_step","_iterator","_createForOfIteratorHelperLoose","builtInColors","done","_step2","finalColors","_iterator2","_step2$value"],"mappings":"w9CAAA,IAAIA,EAAEC,OACFC,EAAO,WAAY,MAAO,CAACC,kBAAiB,EAAMC,MAAMJ,EAAEK,KAAKL,EAAEM,IAAIN,EAAEO,OAAOP,EAAEQ,UAAUR,EAAES,QAAQT,EAAEU,OAAOV,EAAEW,cAAcX,EAAEY,MAAMZ,EAAEa,IAAIb,EAAEc,MAAMd,EAAEe,OAAOf,EAAEgB,KAAKhB,EAAEiB,QAAQjB,EAAEkB,KAAKlB,EAAEmB,MAAMnB,EAAEoB,KAAKpB,EAAEqB,QAAQrB,EAAEsB,MAAMtB,EAAEuB,QAAQvB,EAAEwB,SAASxB,EAAEyB,OAAOzB,EAAE0B,UAAU1B,EAAE2B,OAAO3B,EAAE4B,QAAQ5B,EAAE,EAC1Q6B,EAAC3B,mBACeA,4BCF9B4B,OAAOC,eAAwBC,EAAA,aAAc,CACzCC,OAAO,IAEX,SAAiBC,EAAQC,GACrB,IAAI,IAAIC,KAAQD,EAAIL,OAAOC,eAAeG,EAAQE,EAAM,CACpDC,YAAY,EACZC,IAAKH,EAAIC,IAEjB,CACAG,CAAQP,EAAS,CACb1B,IAAK,WACD,OAAOA,CACV,EACDkC,QAAS,WACL,OAAOC,CACV,IAEL,MAAMC,eAA4BC,EAAyBC,GAC3D,SAASD,EAAyBE,GAC9B,OA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EAAmB,IAEhED,EAAgBC,EAAS,cAAe,SAACe,GAAC,MAAkB,kBAANA,CAAe,IACvET,EAAW,gEAGTP,EAAgBC,EAAS,gBAAiB,SAACe,GAAM,MAAa,kBAANA,CAAe,IACzET,EAAW,kEAEb,IAAMoD,EAAc,CAAC,YAAa,WAAY,WAAY,WAAY,YAEtEC,EAAA/D,EAAA,CAAA,EACKD,EACAK,GAFgBF,EAAa6D,EAAb7D,cAAeN,EAAQmE,EAARnE,SAAUC,EAAQkE,EAARlE,SAAUC,EAAIiE,EAAJjE,KAIlDkE,EAAqB,CAAE,EAC7B,GALmBD,EAAX9D,YAON,IADA,IACkCgE,EAAlCC,EAAAC,EADyB3E,EAAK4E,MACIH,EAAAC,KAAAG,MAAE,CAAzB,IAAA3H,EAAGuH,EAAA1I,MACPuI,EAAYxC,SAAS5E,KAAQwD,IAChC8D,EAAWtH,GAAO0H,EAAc1H,GAEnC,CAUH,IAPA,IAO0C4H,EAFpCC,EAAsB,CAAA,EAE5BC,EAAAL,EAPsB1E,EAAOO,EACxBgE,CAAAA,EAAAA,EACAH,OAKqCS,EAAAE,KAAAH,MAAE,CAAA,IAAAI,EAAAH,EAAA/I,MAA1BsF,EAAM4D,KAIpBF,EAJYE,EAAE5D,IACXD,EAAaC,GAGII,EAAUJ,EAAQ,CAAEjB,SAAAA,EAAUC,SAAAA,EAAUC,KAAAA,IAFxCe,CAIvB,CAED,OAAO0D,CACT"} -------------------------------------------------------------------------------- /dist/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import { DefaultColors } from 'tailwindcss/types/generated/colors.d.js'; 2 | export declare const validColorModes: readonly ["rgb", "lab", "lch", "lrgb", "hcl", "num", "hcg", "oklch", "hsi", "hsl", "hsv", "oklab"]; 3 | type Shades = Exclude | DefaultColors[keyof DefaultColors], string>; 4 | type Colors = Record | DefaultColors; 5 | type ColorMode = (typeof validColorModes)[number]; 6 | type Options = { 7 | includeBase?: boolean; 8 | includeLegacy?: boolean; 9 | lerpEnds?: boolean; 10 | interval?: number; 11 | mode?: ColorMode; 12 | }; 13 | type OptionName = keyof Options; 14 | type Option = Options[T]; 15 | type SingularOptions = Pick; 16 | export declare const lerpColor: (shades: Shades, options?: SingularOptions) => { 17 | [x: string]: string; 18 | }; 19 | export declare const lerpColors: (colorsObj?: Colors, options?: Options) => Record; 20 | export type { Shades as LerpColorsShades, Colors as LerpColorsColors, ColorMode as LerpColorsColorMode, Options as LerpColorsOptions, OptionName as LerpColorsOptionName, Option as LerpColorsOption, SingularOptions as LerpColorsSingularOptions, }; 21 | -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | import chroma, { InterpolationMode } from 'chroma-js'; 2 | 3 | import { DefaultColors } from 'tailwindcss/types/generated/colors.d.js'; 4 | import builtInColors from 'tailwindcss/colors.js'; 5 | 6 | function keys(obj: T): (keyof T)[] { 7 | return Object.keys(obj) as (keyof T)[]; 8 | } 9 | 10 | function entries(obj: T): [keyof T, T[keyof T]][] { 11 | return Object.entries(obj) as [keyof T, T[keyof T]][]; 12 | } 13 | 14 | function hasOwn(obj: T, key: keyof T): key is keyof T { 15 | return Object.prototype.hasOwnProperty.call(obj, key); 16 | } 17 | 18 | // valid color modes for chroma-js 19 | export const validColorModes = [ 20 | 'rgb', 21 | 'lab', 22 | 'lch', 23 | 'lrgb', 24 | 'hcl', 25 | 'num', 26 | 'hcg', 27 | 'oklch', 28 | 'hsi', 29 | 'hsl', 30 | 'hsv', 31 | 'oklab', 32 | ] as const; 33 | 34 | // types for tailwind-lerp-colors 35 | type Shades = Exclude | DefaultColors[keyof DefaultColors], string>; 36 | type Colors = Record | DefaultColors; 37 | type ColorMode = (typeof validColorModes)[number]; 38 | type Options = { 39 | includeBase?: boolean; 40 | includeLegacy?: boolean; 41 | lerpEnds?: boolean; 42 | interval?: number; 43 | mode?: ColorMode; 44 | }; 45 | type OptionName = keyof Options; 46 | type Option = Options[T]; 47 | type SingularOptions = Pick; 48 | 49 | // default options for tailwind-lerp-colors -> lerpColor 50 | const defaultSingleOptions: Required = { 51 | lerpEnds: true, 52 | interval: 25, 53 | mode: 'lrgb', 54 | }; 55 | 56 | // default options for tailwind-lerp-colors -> lerpColors 57 | const defaultOptions = { 58 | includeBase: true, 59 | includeLegacy: false, 60 | ...defaultSingleOptions, 61 | }; 62 | 63 | const isOptionInvalid = (options: Options, optionName: T, test: (k: Option) => boolean) => { 64 | return options && hasOwn(options, optionName) && !test(options[optionName]); 65 | }; 66 | 67 | const throwError = (message: string) => { 68 | throw new Error(message); 69 | }; 70 | 71 | const isValidShade = (shades: Shades | string): shades is Shades => { 72 | if ( 73 | // undefined or null 74 | shades == null || 75 | // check if shades is an object 76 | typeof shades !== 'object' || 77 | // check if shades is an array 78 | Array.isArray(shades) || 79 | shades.toString() !== '[object Object]' || 80 | !keys(shades).some((key) => !isNaN(+key) && +key >= 0 && +key <= 1000) 81 | ) { 82 | return false; 83 | } 84 | return true; 85 | }; 86 | 87 | export const lerpColor = (shades: Shades, options: SingularOptions = {}) => { 88 | // validate lerpEnds 89 | if (isOptionInvalid(options, 'lerpEnds', (v) => typeof v === 'boolean')) 90 | throwError('tailwind-lerp-colors option `lerpEnds` must be a boolean.'); 91 | 92 | // validate interval 93 | if (isOptionInvalid(options, 'interval', (v) => Number.isInteger(v) && typeof v === 'number' && v > 0)) 94 | throwError('tailwind-lerp-colors option `interval` must be a positive integer greater than 0.'); 95 | 96 | // validate mode 97 | if (isOptionInvalid(options, 'mode', (v) => typeof v === 'string' && validColorModes.includes(v))) 98 | throwError( 99 | `tailwind-lerp-colors option \`mode\` must be one of the following values: ${validColorModes.join(', ')}.` 100 | ); 101 | 102 | if (!isValidShade(shades)) 103 | throwError( 104 | `tailwind-lerp-colors object \`shades\` must be an object with numeric keys.\n\nvalue used: ${JSON.stringify( 105 | shades, 106 | null, 107 | 2 108 | )}` 109 | ); 110 | const { lerpEnds, interval, mode } = { 111 | ...defaultSingleOptions, 112 | ...(options ?? {}), 113 | }; 114 | 115 | const sortByNumericFirstIndex = ([numericKeyA]: [number, string], [numericKeyB]: [number, string]) => { 116 | return numericKeyA - numericKeyB; 117 | }; 118 | 119 | const namedShades: Record = {}; 120 | const numericShades = entries(shades) 121 | .flatMap(([key, color]) => { 122 | const numericShade = +key; 123 | if (isNaN(numericShade)) { 124 | namedShades[key] = color; 125 | return []; 126 | } 127 | return [[numericShade, color]] as [[number, string]]; 128 | }) 129 | .sort(sortByNumericFirstIndex); 130 | 131 | if (lerpEnds) { 132 | if (numericShades[0]?.[0] !== 0) numericShades.unshift([0, '#ffffff']); 133 | if (numericShades.slice(-1)[0]?.[0] !== 1000) numericShades.push([1000, '#000000']); 134 | } 135 | const finalShades = [...numericShades]; 136 | for (let i = 0; i < numericShades.length - 1; i++) { 137 | const [shade, color] = numericShades[i] ?? []; 138 | const [nextShade, nextColor] = numericShades[i + 1] ?? []; 139 | if (!shade || !color || !nextShade || !nextColor) { 140 | continue; 141 | } 142 | 143 | // check to make sure both shades being compared 144 | // are evenly divisible by the set interval 145 | const interpolations = (nextShade - shade) / interval - 1; 146 | if (interpolations <= 0 || !Number.isInteger(interpolations)) continue; 147 | 148 | const scale = chroma.scale([color, nextColor]).mode(mode as InterpolationMode); 149 | const getColorAt = (percent: number) => scale(percent).hex(); 150 | for (let run = 1; run <= interpolations; run++) { 151 | const percent = run / (interpolations + 1); 152 | finalShades.push([shade + interval * run, getColorAt(percent)]); 153 | } 154 | } 155 | finalShades.sort(sortByNumericFirstIndex); 156 | 157 | return { 158 | ...Object.fromEntries(finalShades), 159 | ...namedShades, 160 | }; 161 | }; 162 | 163 | export const lerpColors = (colorsObj: Colors = {}, options: Options = {}) => { 164 | // validate includeBase 165 | if (isOptionInvalid(options, 'includeBase', (v) => typeof v === 'boolean')) 166 | throwError('tailwind-lerp-colors option `includeBase` must be a boolean.'); 167 | 168 | // validate includeLegacy 169 | if (isOptionInvalid(options, 'includeLegacy', (v) => typeof v === 'boolean')) 170 | throwError('tailwind-lerp-colors option `includeLegacy` must be a boolean.'); 171 | 172 | const legacyNames = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray']; 173 | 174 | const { includeBase, includeLegacy, lerpEnds, interval, mode } = { 175 | ...defaultOptions, 176 | ...options, 177 | }; 178 | const baseColors: Colors = {}; 179 | if (includeBase) { 180 | const builtInColorKeys = keys(builtInColors); 181 | for (const key of builtInColorKeys) { 182 | if (!legacyNames.includes(key) || includeLegacy) { 183 | baseColors[key] = builtInColors[key]; 184 | } 185 | } 186 | } 187 | 188 | const initialColors = entries({ 189 | ...baseColors, 190 | ...colorsObj, 191 | }); 192 | 193 | const finalColors: Colors = {}; 194 | 195 | for (const [name, shades] of initialColors) { 196 | if (!isValidShade(shades)) { 197 | finalColors[name] = shades; 198 | } else { 199 | finalColors[name] = lerpColor(shades, { lerpEnds, interval, mode }); 200 | } 201 | } 202 | 203 | return finalColors; 204 | }; 205 | 206 | export type { 207 | Shades as LerpColorsShades, 208 | Colors as LerpColorsColors, 209 | ColorMode as LerpColorsColorMode, 210 | Options as LerpColorsOptions, 211 | OptionName as LerpColorsOptionName, 212 | Option as LerpColorsOption, 213 | SingularOptions as LerpColorsSingularOptions, 214 | }; 215 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest').JestConfigWithTsJest} */ 2 | module.exports = { 3 | preset: 'ts-jest', 4 | testEnvironment: 'node', 5 | }; 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tailwindcss-lerp-colors", 3 | "version": "1.2.20", 4 | "description": "Interpolate between defined colors in Tailwind config for additional color stops", 5 | "type": "module", 6 | "source": "index.ts", 7 | "exports": { 8 | "types": "./dist/types/index.d.ts", 9 | "require": "./dist/index.cjs", 10 | "default": "./dist/index.modern.js" 11 | }, 12 | "types": "dist/types/index.d.ts", 13 | "main": "./dist/index.cjs", 14 | "module": "./dist/index.module.js", 15 | "unpkg": "./dist/index.umd.js", 16 | "scripts": { 17 | "test": "echo \"Error: no test specified\" && exit 1", 18 | "build": "microbundle", 19 | "dev": "microbundle watch" 20 | }, 21 | "publishConfig": { 22 | "access": "public" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "git+https://github.com/brandonmcconnell/tailwind-lerp-colors.git" 27 | }, 28 | "keywords": [ 29 | "tailwind", 30 | "plugin", 31 | "color", 32 | "interpolation", 33 | "functions", 34 | "linear", 35 | "interpolate-colors", 36 | "chroma", 37 | "color-space", 38 | "color-modes", 39 | "interpolate", 40 | "color-spaces", 41 | "color-mode" 42 | ], 43 | "author": "Brandon McConnell", 44 | "license": "MIT", 45 | "bugs": { 46 | "url": "https://github.com/brandonmcconnell/tailwind-lerp-colors/issues" 47 | }, 48 | "homepage": "https://github.com/brandonmcconnell/tailwind-lerp-colors#readme", 49 | "dependencies": { 50 | "chroma-js": "^2.4.2" 51 | }, 52 | "devDependencies": { 53 | "@types/chroma-js": "^2.4.0", 54 | "@types/jest": "^29.5.2", 55 | "@typescript-eslint/eslint-plugin": "^5.59.8", 56 | "@typescript-eslint/parser": "^5.59.8", 57 | "eslint": "^8.41.0", 58 | "eslint-config-prettier": "^8.8.0", 59 | "eslint-plugin-prettier": "^4.2.1", 60 | "jest": "^29.5.0", 61 | "microbundle": "^0.15.1", 62 | "npm-run-all": "^4.1.5", 63 | "tailwindcss": "^3.4.3", 64 | "ts-jest": "^29.1.0", 65 | "typescript": "^5.1.3" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /tests/__mocks__/mockData.ts: -------------------------------------------------------------------------------- 1 | const rgb = [ 2 | { 3 | input: { 4 | '100': '#ffffff', 5 | '200': '#000000', 6 | }, 7 | output: { 8 | '100': '#ffffff', 9 | '125': '#bfbfbf', 10 | '150': '#808080', 11 | '175': '#404040', 12 | '200': '#000000', 13 | }, 14 | }, 15 | { 16 | input: { 17 | '100': '#ff0000', 18 | '200': '#15ff00', 19 | }, 20 | output: { 21 | '100': '#ff0000', 22 | '125': '#c54000', 23 | '150': '#8a8000', 24 | '175': '#50bf00', 25 | '200': '#15ff00', 26 | }, 27 | }, 28 | { 29 | input: { 30 | '100': '#00ff15', 31 | '200': '#003cff', 32 | }, 33 | output: { 34 | '100': '#00ff15', 35 | '125': '#00ce50', 36 | '150': '#009e8a', 37 | '175': '#006dc5', 38 | '200': '#003cff', 39 | }, 40 | }, 41 | ]; 42 | const lab = [ 43 | { 44 | input: { 45 | '100': '#ffffff', 46 | '200': '#000000', 47 | }, 48 | output: { 49 | '100': '#ffffff', 50 | '125': '#b9b9b9', 51 | '150': '#777777', 52 | '175': '#3b3b3b', 53 | '200': '#000000', 54 | }, 55 | }, 56 | { 57 | input: { 58 | '100': '#ff0000', 59 | '200': '#15ff00', 60 | }, 61 | output: { 62 | '100': '#ff0000', 63 | '125': '#e97600', 64 | '150': '#c9ab00', 65 | '175': '#99d700', 66 | '200': '#15ff00', 67 | }, 68 | }, 69 | { 70 | input: { 71 | '100': '#00ff15', 72 | '200': '#003cff', 73 | }, 74 | output: { 75 | '100': '#00ff15', 76 | '125': '#68d073', 77 | '150': '#76a0a7', 78 | '175': '#6670d4', 79 | '200': '#003cff', 80 | }, 81 | }, 82 | ]; 83 | const lch = [ 84 | { 85 | input: { 86 | '100': '#ffffff', 87 | '200': '#000000', 88 | }, 89 | output: { 90 | '100': '#ffffff', 91 | '125': '#b9b9b9', 92 | '150': '#777777', 93 | '175': '#3b3b3b', 94 | '200': '#000000', 95 | }, 96 | }, 97 | { 98 | input: { 99 | '100': '#ff0000', 100 | '200': '#15ff00', 101 | }, 102 | output: { 103 | '100': '#ff0000', 104 | '125': '#f66d00', 105 | '150': '#d7a600', 106 | '175': '#a2d600', 107 | '200': '#15ff00', 108 | }, 109 | }, 110 | { 111 | input: { 112 | '100': '#00ff15', 113 | '200': '#003cff', 114 | }, 115 | output: { 116 | '100': '#00ff15', 117 | '125': '#00e5af', 118 | '150': '#00c1ff', 119 | '175': '#0091ff', 120 | '200': '#003cff', 121 | }, 122 | }, 123 | ]; 124 | const lrgb = [ 125 | { 126 | input: { 127 | '100': '#ffffff', 128 | '200': '#000000', 129 | }, 130 | output: { 131 | '100': '#ffffff', 132 | '125': '#dddddd', 133 | '150': '#b4b4b4', 134 | '175': '#808080', 135 | '200': '#000000', 136 | }, 137 | }, 138 | { 139 | input: { 140 | '100': '#ff0000', 141 | '200': '#15ff00', 142 | }, 143 | output: { 144 | '100': '#ff0000', 145 | '125': '#dd8000', 146 | '150': '#b5b400', 147 | '175': '#81dd00', 148 | '200': '#15ff00', 149 | }, 150 | }, 151 | { 152 | input: { 153 | '100': '#00ff15', 154 | '200': '#003cff', 155 | }, 156 | output: { 157 | '100': '#00ff15', 158 | '125': '#00df81', 159 | '150': '#00b9b5', 160 | '175': '#008add', 161 | '200': '#003cff', 162 | }, 163 | }, 164 | ]; 165 | const hcl = [ 166 | { 167 | input: { 168 | '100': '#ffffff', 169 | '200': '#000000', 170 | }, 171 | output: { 172 | '100': '#ffffff', 173 | '125': '#b9b9b9', 174 | '150': '#777777', 175 | '175': '#3b3b3b', 176 | '200': '#000000', 177 | }, 178 | }, 179 | { 180 | input: { 181 | '100': '#ff0000', 182 | '200': '#15ff00', 183 | }, 184 | output: { 185 | '100': '#ff0000', 186 | '125': '#f66d00', 187 | '150': '#d7a600', 188 | '175': '#a2d600', 189 | '200': '#15ff00', 190 | }, 191 | }, 192 | { 193 | input: { 194 | '100': '#00ff15', 195 | '200': '#003cff', 196 | }, 197 | output: { 198 | '100': '#00ff15', 199 | '125': '#00e5af', 200 | '150': '#00c1ff', 201 | '175': '#0091ff', 202 | '200': '#003cff', 203 | }, 204 | }, 205 | ]; 206 | const num = [ 207 | { 208 | input: { 209 | '100': '#ffffff', 210 | '200': '#000000', 211 | }, 212 | output: { 213 | '100': '#ffffff', 214 | '125': '#bfffff', 215 | '150': '#7fffff', 216 | '175': '#3fffff', 217 | '200': '#000000', 218 | }, 219 | }, 220 | { 221 | input: { 222 | '100': '#ff0000', 223 | '200': '#15ff00', 224 | }, 225 | output: { 226 | '100': '#ff0000', 227 | '125': '#c4bfc0', 228 | '150': '#8a7f80', 229 | '175': '#503f40', 230 | '200': '#15ff00', 231 | }, 232 | }, 233 | { 234 | input: { 235 | '100': '#00ff15', 236 | '200': '#003cff', 237 | }, 238 | output: { 239 | '100': '#00ff15', 240 | '125': '#00ce8f', 241 | '150': '#009e0a', 242 | '175': '#006d84', 243 | '200': '#003cff', 244 | }, 245 | }, 246 | ]; 247 | const hcg = [ 248 | { 249 | input: { 250 | '100': '#ffffff', 251 | '200': '#000000', 252 | }, 253 | output: { 254 | '100': '#ffffff', 255 | '125': '#ffffff', 256 | '150': '#ffffff', 257 | '175': '#ffffff', 258 | '200': '#000000', 259 | }, 260 | }, 261 | { 262 | input: { 263 | '100': '#ff0000', 264 | '200': '#15ff00', 265 | }, 266 | output: { 267 | '100': '#ff0000', 268 | '125': '#000000', 269 | '150': '#000000', 270 | '175': '#000000', 271 | '200': '#15ff00', 272 | }, 273 | }, 274 | { 275 | input: { 276 | '100': '#00ff15', 277 | '200': '#003cff', 278 | }, 279 | output: { 280 | '100': '#00ff15', 281 | '125': '#000000', 282 | '150': '#000000', 283 | '175': '#000000', 284 | '200': '#003cff', 285 | }, 286 | }, 287 | ]; 288 | const oklch = [ 289 | { 290 | input: { 291 | '100': '#ffffff', 292 | '200': '#000000', 293 | }, 294 | output: { 295 | '100': '#ffffff', 296 | '125': '#aeaeae', 297 | '150': '#636363', 298 | '175': '#222222', 299 | '200': '#000000', 300 | }, 301 | }, 302 | { 303 | input: { 304 | '100': '#ff0000', 305 | '200': '#15ff00', 306 | }, 307 | output: { 308 | '100': '#ff0000', 309 | '125': '#ff5600', 310 | '150': '#f99500', 311 | '175': '#c2ce00', 312 | '200': '#15ff00', 313 | }, 314 | }, 315 | { 316 | input: { 317 | '100': '#00ff15', 318 | '200': '#003cff', 319 | }, 320 | output: { 321 | '100': '#00ff15', 322 | '125': '#00eaa4', 323 | '150': '#00c1e7', 324 | '175': '#0087ff', 325 | '200': '#003cff', 326 | }, 327 | }, 328 | ]; 329 | const hsi = [ 330 | { 331 | input: { 332 | '100': '#ffffff', 333 | '200': '#000000', 334 | }, 335 | output: { 336 | '100': '#ffffff', 337 | '125': '#bfbfbf', 338 | '150': '#808080', 339 | '175': '#404040', 340 | '200': '#000000', 341 | }, 342 | }, 343 | { 344 | input: { 345 | '100': '#ff0000', 346 | '200': '#15ff00', 347 | }, 348 | output: { 349 | '100': '#ff0000', 350 | '125': '#af5500', 351 | '150': '#888200', 352 | '175': '#60af00', 353 | '200': '#15ff00', 354 | }, 355 | }, 356 | { 357 | input: { 358 | '100': '#00ff15', 359 | '200': '#003cff', 360 | }, 361 | output: { 362 | '100': '#00ff15', 363 | '125': '#00bf5f', 364 | '150': '#009a8d', 365 | '175': '#0076bb', 366 | '200': '#003cff', 367 | }, 368 | }, 369 | ]; 370 | const hsl = [ 371 | { 372 | input: { 373 | '100': '#ffffff', 374 | '200': '#000000', 375 | }, 376 | output: { 377 | '100': '#ffffff', 378 | '125': '#bfbfbf', 379 | '150': '#808080', 380 | '175': '#404040', 381 | '200': '#000000', 382 | }, 383 | }, 384 | { 385 | input: { 386 | '100': '#ff0000', 387 | '200': '#15ff00', 388 | }, 389 | output: { 390 | '100': '#ff0000', 391 | '125': '#ff7a00', 392 | '150': '#fff500', 393 | '175': '#8fff00', 394 | '200': '#15ff00', 395 | }, 396 | }, 397 | { 398 | input: { 399 | '100': '#00ff15', 400 | '200': '#003cff', 401 | }, 402 | output: { 403 | '100': '#00ff15', 404 | '125': '#00ff80', 405 | '150': '#00ffec', 406 | '175': '#00a7ff', 407 | '200': '#003cff', 408 | }, 409 | }, 410 | ]; 411 | const hsv = [ 412 | { 413 | input: { 414 | '100': '#ffffff', 415 | '200': '#000000', 416 | }, 417 | output: { 418 | '100': '#ffffff', 419 | '125': '#bfbfbf', 420 | '150': '#808080', 421 | '175': '#404040', 422 | '200': '#000000', 423 | }, 424 | }, 425 | { 426 | input: { 427 | '100': '#ff0000', 428 | '200': '#15ff00', 429 | }, 430 | output: { 431 | '100': '#ff0000', 432 | '125': '#ff7a00', 433 | '150': '#fff500', 434 | '175': '#8fff00', 435 | '200': '#15ff00', 436 | }, 437 | }, 438 | { 439 | input: { 440 | '100': '#00ff15', 441 | '200': '#003cff', 442 | }, 443 | output: { 444 | '100': '#00ff15', 445 | '125': '#00ff80', 446 | '150': '#00ffeb', 447 | '175': '#00a7ff', 448 | '200': '#003cff', 449 | }, 450 | }, 451 | ]; 452 | const oklab = [ 453 | { 454 | input: { 455 | '100': '#ffffff', 456 | '200': '#000000', 457 | }, 458 | output: { 459 | '100': '#ffffff', 460 | '125': '#aeaeae', 461 | '150': '#636363', 462 | '175': '#222222', 463 | '200': '#000000', 464 | }, 465 | }, 466 | { 467 | input: { 468 | '100': '#ff0000', 469 | '200': '#15ff00', 470 | }, 471 | output: { 472 | '100': '#ff0000', 473 | '125': '#ed7300', 474 | '150': '#d1a800', 475 | '175': '#a1d500', 476 | '200': '#15ff00', 477 | }, 478 | }, 479 | { 480 | input: { 481 | '100': '#00ff15', 482 | '200': '#003cff', 483 | }, 484 | output: { 485 | '100': '#00ff15', 486 | '125': '#00d98c', 487 | '150': '#00b1be', 488 | '175': '#0082e1', 489 | '200': '#003cff', 490 | }, 491 | }, 492 | ]; 493 | export const COLOR_MODES_MOCK_DATA = { 494 | rgb, 495 | hcl, 496 | num, 497 | hcg, 498 | oklch, 499 | hsi, 500 | hsl, 501 | hsv, 502 | oklab, 503 | lab, 504 | lch, 505 | lrgb, 506 | } as const; 507 | -------------------------------------------------------------------------------- /tests/index.test.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/ban-ts-comment */ 2 | import { lerpColor, lerpColors, validColorModes } from '../index'; 3 | import defaultTailwindColors from 'tailwindcss/colors'; 4 | import { COLOR_MODES_MOCK_DATA } from './__mocks__/mockData'; 5 | 6 | describe('lerpColor', () => { 7 | // error handling 8 | describe('invalid option errors', () => { 9 | // lerp ends 10 | test('should throw error if lerpEnds not boolean', () => { 11 | expect.assertions(1); 12 | 13 | try { 14 | lerpColor( 15 | { 100: '#000' }, 16 | { 17 | // @ts-expect-error 18 | lerpEnds: 'true', 19 | } 20 | ); 21 | } catch (e) { 22 | expect((e as Error).message).toBe('tailwind-lerp-colors option `lerpEnds` must be a boolean.'); 23 | } 24 | }); 25 | 26 | // interval 27 | test('should throw error if interval not integer', () => { 28 | expect.assertions(1); 29 | 30 | try { 31 | lerpColor( 32 | { 100: '#000' }, 33 | { 34 | // @ts-expect-error 35 | interval: '25', 36 | } 37 | ); 38 | } catch (e) { 39 | expect((e as Error).message).toBe( 40 | 'tailwind-lerp-colors option `interval` must be a positive integer greater than 0.' 41 | ); 42 | } 43 | }); 44 | 45 | // interval negative; 46 | test('should throw error if interval negative', () => { 47 | expect.assertions(1); 48 | 49 | try { 50 | lerpColor( 51 | { 100: '#000' }, 52 | { 53 | interval: -25, 54 | } 55 | ); 56 | } catch (e) { 57 | expect((e as Error).message).toBe( 58 | 'tailwind-lerp-colors option `interval` must be a positive integer greater than 0.' 59 | ); 60 | } 61 | }); 62 | 63 | // zero interval 64 | test('should throw error if interval zero', () => { 65 | expect.assertions(1); 66 | 67 | try { 68 | lerpColor( 69 | { 100: '#000' }, 70 | { 71 | interval: 0, 72 | } 73 | ); 74 | } catch (e) { 75 | expect((e as Error).message).toBe( 76 | 'tailwind-lerp-colors option `interval` must be a positive integer greater than 0.' 77 | ); 78 | } 79 | }); 80 | 81 | // mode one of validColorModes 82 | test('should throw error if mode not one of validColorModes', () => { 83 | expect.assertions(1); 84 | 85 | try { 86 | lerpColor( 87 | { 100: '#000' }, 88 | { 89 | // @ts-expect-error 90 | mode: 'invalid', 91 | } 92 | ); 93 | } catch (e) { 94 | expect((e as Error).message).toBe( 95 | `tailwind-lerp-colors option \`mode\` must be one of the following values: ${validColorModes.join(', ')}.` 96 | ); 97 | } 98 | }); 99 | 100 | // shades should throw error if null 101 | test('should throw error if shades is not valid object', () => { 102 | expect.assertions(6); 103 | 104 | try { 105 | // @ts-expect-error 106 | lerpColor(null); 107 | } catch (e) { 108 | expect((e as Error).message).toBe( 109 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: null' 110 | ); 111 | } 112 | 113 | try { 114 | // @ts-expect-error 115 | lerpColor(undefined); 116 | } catch (e) { 117 | expect((e as Error).message).toBe( 118 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: undefined' 119 | ); 120 | } 121 | 122 | try { 123 | lerpColor([]); 124 | } catch (e) { 125 | expect((e as Error).message).toBe( 126 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: []' 127 | ); 128 | } 129 | 130 | try { 131 | lerpColor('string'); 132 | } catch (e) { 133 | expect((e as Error).message).toBe( 134 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: "string"' 135 | ); 136 | } 137 | try { 138 | // @ts-expect-error 139 | lerpColor(true); 140 | } catch (e) { 141 | expect((e as Error).message).toBe( 142 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: true' 143 | ); 144 | } 145 | 146 | try { 147 | // @ts-expect-error 148 | lerpColor(1); 149 | } catch (e) { 150 | expect((e as Error).message).toBe( 151 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: 1' 152 | ); 153 | } 154 | }); 155 | 156 | // should throw error if object with non-numeric keys 157 | test('should throw error if shades is object with non-numeric keys', () => { 158 | expect.assertions(1); 159 | 160 | try { 161 | // @ts-expect-error 162 | lerpColor({ 100: '#000', invalid: '#fff' }); 163 | } catch (e) { 164 | expect((e as Error).message).toBe( 165 | 'tailwind-lerp-colors object `shades` must be an object with numeric keys.\n\nvalue used: {\n "100": "#000",\n "invalid": "#fff"\n}' 166 | ); 167 | } 168 | }); 169 | test('should not throw error when all valid options', () => { 170 | expect(() => { 171 | lerpColor( 172 | { 100: '#000' }, 173 | { 174 | lerpEnds: true, 175 | interval: 25, 176 | mode: 'rgb', 177 | } 178 | ); 179 | }).not.toThrow(); 180 | }); 181 | }); 182 | 183 | describe('lerpEnds', () => { 184 | test('should start #ffffff and end #000000 when lerpEnds: true', () => { 185 | expect.assertions(4); 186 | const result = lerpColor( 187 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 188 | { 189 | lerpEnds: true, 190 | } 191 | ); 192 | 193 | expect(result[0]).toBe('#ffffff'); 194 | expect(result[100]).toBe('#f1f1f1'); 195 | expect(result[200]).toBe('#f3f3f3'); 196 | expect(result[1000]).toBe('#000000'); 197 | }); 198 | 199 | test('should default to initial colors if no lerpEnds', () => { 200 | const result = lerpColor( 201 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 202 | { 203 | lerpEnds: false, 204 | } 205 | ); 206 | expect(result[0]).toBeUndefined(); 207 | expect(result[100]).toBe('#f1f1f1'); 208 | expect(result[200]).toBe('#f3f3f3'); 209 | expect(result[1000]).toBeUndefined(); 210 | }); 211 | 212 | // should lerp from #ffffff to start color correctly 213 | test('should lerp from #ffffff to start color correctly', () => { 214 | const result = lerpColor( 215 | { 100: '#f1f1f1' }, 216 | { 217 | lerpEnds: true, 218 | } 219 | ); 220 | expect(result[0]).toBe('#ffffff'); 221 | expect(result[25]).toBe('#fcfcfc'); 222 | expect(result[50]).toBe('#f8f8f8'); 223 | expect(result[75]).toBe('#f5f5f5'); 224 | expect(result[100]).toBe('#f1f1f1'); 225 | }); 226 | 227 | // should lerp from end color to #000000 correctly 228 | test('should lerp from end color to #000000 correctly', () => { 229 | const result = lerpColor( 230 | { 900: '#f1f1f1' }, 231 | { 232 | lerpEnds: true, 233 | } 234 | ); 235 | expect(result[900]).toBe('#f1f1f1'); 236 | expect(result[925]).toBe('#d1d1d1'); 237 | expect(result[950]).toBe('#aaaaaa'); 238 | expect(result[975]).toBe('#797979'); 239 | expect(result[1000]).toBe('#000000'); 240 | }); 241 | }); 242 | 243 | describe('interval boundary conditions', () => { 244 | // should correctly interval for given interval 245 | test('should add intervals for input interval < minimum interval from input', () => { 246 | expect.assertions(2); 247 | const result1 = lerpColor( 248 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 249 | { 250 | lerpEnds: false, 251 | interval: 25, 252 | } 253 | ); 254 | expect(Object.keys(result1)).toEqual(['100', '125', '150', '175', '200']); 255 | 256 | // interval 50; 257 | const result2 = lerpColor( 258 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 259 | { 260 | lerpEnds: false, 261 | interval: 50, 262 | } 263 | ); 264 | expect(Object.keys(result2)).toEqual(['100', '150', '200']); 265 | }); 266 | 267 | // should interval correctly for 100; 268 | test('should not add interval between minimum interval, when input interval = minimum interval', () => { 269 | expect.assertions(1); 270 | const result = lerpColor( 271 | { 100: '#f1f1f1', 200: '#f3f3f3', 500: '#f5f5f5' }, 272 | { 273 | lerpEnds: false, 274 | interval: 100, 275 | } 276 | ); 277 | expect(Object.keys(result)).toEqual(['100', '200', '300', '400', '500']); 278 | }); 279 | 280 | // should interval correctly for greater than 100 281 | test('should add intervals at >minimum interval gaps, when input interval > minimum input interval', () => { 282 | expect.assertions(1); 283 | const result = lerpColor( 284 | { 100: '#f1f1f1', 200: '#f3f3f3', 500: '#f5f5f5' }, 285 | { 286 | lerpEnds: false, 287 | interval: 150, 288 | } 289 | ); 290 | expect(Object.keys(result)).toEqual(['100', '200', '350', '500']); 291 | }); 292 | 293 | // should not add interval if interval > maximum input interval 294 | test('should not add intervals anywhere when interval > maximum input interval', () => { 295 | expect.assertions(1); 296 | const result = lerpColor( 297 | { 100: '#f1f1f1', 200: '#f3f3f3', 500: '#f5f5f5' }, 298 | { 299 | lerpEnds: false, 300 | interval: 600, 301 | } 302 | ); 303 | expect(Object.keys(result)).toEqual(['100', '200', '500']); 304 | }); 305 | }); 306 | 307 | describe('interval random testing', () => { 308 | test(`interval value: 10`, () => { 309 | const result = lerpColor( 310 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 311 | { 312 | lerpEnds: false, 313 | interval: 10, 314 | } 315 | ); 316 | 317 | expect(Object.keys(result)).toEqual([ 318 | '100', 319 | '110', 320 | '120', 321 | '130', 322 | '140', 323 | '150', 324 | '160', 325 | '170', 326 | '180', 327 | '190', 328 | '200', 329 | ]); 330 | }); 331 | 332 | // 25 333 | test(`interval value: 25`, () => { 334 | const result = lerpColor( 335 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 336 | { 337 | lerpEnds: false, 338 | interval: 25, 339 | } 340 | ); 341 | 342 | expect(Object.keys(result)).toEqual(['100', '125', '150', '175', '200']); 343 | }); 344 | 345 | // 50 346 | test(`interval value: 50`, () => { 347 | const result = lerpColor( 348 | { 100: '#f1f1f1', 200: '#f3f3f3' }, 349 | { 350 | lerpEnds: false, 351 | interval: 50, 352 | } 353 | ); 354 | 355 | expect(Object.keys(result)).toEqual(['100', '150', '200']); 356 | }); 357 | 358 | // 100 359 | test(`interval value: 100`, () => { 360 | const result = lerpColor( 361 | { 100: '#f1f1f1', 300: '#f3f3f3' }, 362 | { 363 | lerpEnds: false, 364 | interval: 100, 365 | } 366 | ); 367 | 368 | expect(Object.keys(result)).toEqual(['100', '200', '300']); 369 | }); 370 | }); 371 | 372 | describe('modes', () => { 373 | validColorModes.forEach((mode) => { 374 | // should correctly lerp for mode 375 | test(`should lerp for mode ${mode}`, () => { 376 | COLOR_MODES_MOCK_DATA[mode].forEach((data) => { 377 | expect(lerpColor(data.input, { mode, lerpEnds: false })).toEqual(data.output); 378 | }); 379 | }); 380 | }); 381 | }); 382 | 383 | describe('option defaulting', () => { 384 | // should default to lerpEnds: true 385 | test('should default to lerpEnds: true', () => { 386 | const result = lerpColor({ 100: '#f1f1f1', 200: '#f3f3f3' }); 387 | expect(result[0]).toBe('#ffffff'); 388 | expect(result[100]).toBe('#f1f1f1'); 389 | expect(result[200]).toBe('#f3f3f3'); 390 | expect(result[1000]).toBe('#000000'); 391 | }); 392 | 393 | // should default interval to 25; 394 | test('should default interval to 25', () => { 395 | const result = lerpColor({ 100: '#f1f1f1', 200: '#f3f3f3' }, { lerpEnds: false }); 396 | expect(Object.keys(result)).toEqual(['100', '125', '150', '175', '200']); 397 | }); 398 | 399 | // should default mode to lrgb; 400 | test('should default mode to lrgb', () => { 401 | const result = lerpColor({ 100: '#f1f1f1', 200: '#f3f3f3' }, { lerpEnds: false, interval: 50 }); 402 | expect(Object.keys(result)).toEqual(['100', '150', '200']); 403 | }); 404 | 405 | // should default to empty object if options undefined 406 | test('should default to empty object if options undefined', () => { 407 | const result = lerpColor(COLOR_MODES_MOCK_DATA.lrgb[0].input); 408 | // does lerping 409 | expect(result[0]).toBe('#ffffff'); 410 | expect(result[1000]).toBe('#000000'); 411 | expect(result).toMatchObject(COLOR_MODES_MOCK_DATA.lrgb[0].output); 412 | }); 413 | 414 | // should spread empty object when options null; 415 | test('should spread empty object when options null', () => { 416 | // @ts-ignore 417 | const result = lerpColor(COLOR_MODES_MOCK_DATA.lrgb[0].input, null); 418 | // does lerping 419 | expect(result[0]).toBe('#ffffff'); 420 | expect(result[1000]).toBe('#000000'); 421 | expect(result).toMatchObject(COLOR_MODES_MOCK_DATA.lrgb[0].output); 422 | }); 423 | }); 424 | }); 425 | 426 | describe('lerpColors', () => { 427 | // error handling 428 | describe('invalid option errors', () => { 429 | // should throw error if includeBase not boolean 430 | test('should throw error if includeBase not boolean', () => { 431 | expect.assertions(1); 432 | 433 | try { 434 | lerpColors( 435 | { 436 | test: { 437 | 100: '#000', 438 | }, 439 | }, 440 | { 441 | // @ts-expect-error 442 | includeBase: 'true', 443 | } 444 | ); 445 | } catch (e) { 446 | expect((e as Error).message).toBe('tailwind-lerp-colors option `includeBase` must be a boolean.'); 447 | } 448 | }); 449 | 450 | // throw error if includeLegacy not boolean 451 | test('should throw error if includeLegacy not boolean', () => { 452 | expect.assertions(1); 453 | 454 | try { 455 | lerpColors( 456 | { 457 | test: { 458 | 100: '#000', 459 | }, 460 | }, 461 | { 462 | // @ts-expect-error 463 | includeLegacy: 'true', 464 | } 465 | ); 466 | } catch (e) { 467 | expect((e as Error).message).toBe('tailwind-lerp-colors option `includeLegacy` must be a boolean.'); 468 | } 469 | }); 470 | // lerp ends 471 | test('should throw error if lerpEnds not boolean', () => { 472 | expect.assertions(1); 473 | 474 | try { 475 | lerpColors( 476 | { 477 | test: { 478 | 100: '#000', 479 | }, 480 | }, 481 | { 482 | // @ts-expect-error 483 | lerpEnds: 'true', 484 | } 485 | ); 486 | } catch (e) { 487 | expect((e as Error).message).toBe('tailwind-lerp-colors option `lerpEnds` must be a boolean.'); 488 | } 489 | }); 490 | 491 | // interval 492 | test('should throw error if interval not integer', () => { 493 | expect.assertions(1); 494 | 495 | try { 496 | lerpColors( 497 | { 498 | test: { 499 | 100: '#000', 500 | }, 501 | }, 502 | { 503 | // @ts-expect-error 504 | interval: '25', 505 | } 506 | ); 507 | } catch (e) { 508 | expect((e as Error).message).toBe( 509 | 'tailwind-lerp-colors option `interval` must be a positive integer greater than 0.' 510 | ); 511 | } 512 | }); 513 | 514 | // interval negative; 515 | test('should throw error if interval negative', () => { 516 | expect.assertions(1); 517 | 518 | try { 519 | lerpColors( 520 | { 521 | test: { 522 | 100: '#000', 523 | }, 524 | }, 525 | { 526 | interval: -25, 527 | } 528 | ); 529 | } catch (e) { 530 | expect((e as Error).message).toBe( 531 | 'tailwind-lerp-colors option `interval` must be a positive integer greater than 0.' 532 | ); 533 | } 534 | }); 535 | 536 | // mode one of validColorModes 537 | test('should throw error if mode not one of validColorModes', () => { 538 | expect.assertions(1); 539 | 540 | try { 541 | lerpColors( 542 | { 543 | test: { 544 | 100: '#000', 545 | }, 546 | }, 547 | { 548 | // @ts-expect-error 549 | mode: 'invalid', 550 | } 551 | ); 552 | } catch (e) { 553 | expect((e as Error).message).toBe( 554 | `tailwind-lerp-colors option \`mode\` must be one of the following values: ${validColorModes.join(', ')}.` 555 | ); 556 | } 557 | }); 558 | 559 | // zero interval 560 | test('should throw error if interval zero', () => { 561 | expect.assertions(1); 562 | 563 | try { 564 | lerpColor( 565 | { 100: '#000' }, 566 | { 567 | interval: 0, 568 | } 569 | ); 570 | } catch (e) { 571 | expect((e as Error).message).toBe( 572 | 'tailwind-lerp-colors option `interval` must be a positive integer greater than 0.' 573 | ); 574 | } 575 | }); 576 | }); 577 | 578 | const validTailwindColorKeys = Object.keys(defaultTailwindColors); 579 | 580 | const legacyColors = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray']; 581 | 582 | // include base 583 | describe('includeBase', () => { 584 | // should include tailwind base colors if includeBase: true 585 | test('should include tailwind base colors if includeBase: true', () => { 586 | const result = lerpColors( 587 | { 588 | test: { 589 | 100: '#000', 590 | }, 591 | }, 592 | { 593 | includeBase: true, 594 | includeLegacy: true, 595 | } 596 | ); 597 | expect(Object.keys(result)).toEqual([...validTailwindColorKeys, 'test']); 598 | }); 599 | 600 | // should not include tailwind base colors if includeBase: false 601 | test('should not include tailwind base colors if includeBase: false', () => { 602 | expect.assertions(1); 603 | const result = lerpColors( 604 | { 605 | test: { 606 | 100: '#000', 607 | }, 608 | }, 609 | { 610 | includeBase: false, 611 | includeLegacy: true, 612 | } 613 | ); 614 | expect(Object.keys(result)).toEqual(['test']); 615 | }); 616 | }); 617 | 618 | // include legacy 619 | describe('includeLegacy', () => { 620 | // should include tailwind legacy colors if includeLegacy: true 621 | test('should include tailwind legacy colors if includeLegacy: true', () => { 622 | expect.assertions(1); 623 | const result = lerpColors( 624 | { 625 | test: { 626 | 100: '#000', 627 | }, 628 | }, 629 | { 630 | includeBase: true, 631 | includeLegacy: true, 632 | } 633 | ); 634 | expect(Object.keys(result)).toEqual([...validTailwindColorKeys, 'test']); 635 | }); 636 | 637 | // should not include tailwind legacy colors if includeLegacy: false 638 | test('should not include tailwind legacy colors if includeLegacy: false', () => { 639 | expect.assertions(1); 640 | const result = lerpColors( 641 | { 642 | test: { 643 | 100: '#000', 644 | }, 645 | }, 646 | { 647 | includeBase: true, 648 | includeLegacy: false, 649 | } 650 | ); 651 | 652 | expect(Object.keys(result)).toEqual( 653 | [...validTailwindColorKeys, 'test'].filter((color) => !legacyColors.includes(color)) 654 | ); 655 | }); 656 | }); 657 | 658 | // lerp ends 659 | describe('lerpEnds', () => { 660 | // should do lerpEnds for all colors if lerpEnds: true 661 | test('should do lerpEnds for all colors if lerpEnds: true', () => { 662 | const result = lerpColors( 663 | { 664 | test1: { 665 | 100: '#f4f4f4', 666 | 200: '#a7a7a7', 667 | }, 668 | test2: { 669 | 100: '#f5f5f5', 670 | 200: '#dedede', 671 | }, 672 | }, 673 | { 674 | lerpEnds: true, 675 | } 676 | ); 677 | 678 | expect(result.test1).toEqual( 679 | lerpColor( 680 | { 100: '#f4f4f4', 200: '#a7a7a7' }, 681 | { 682 | lerpEnds: true, 683 | } 684 | ) 685 | ); 686 | 687 | expect(result.test2).toEqual( 688 | lerpColor( 689 | { 690 | 100: '#f5f5f5', 691 | 200: '#dedede', 692 | }, 693 | { 694 | lerpEnds: true, 695 | } 696 | ) 697 | ); 698 | }); 699 | 700 | // should start and end from passed colors if lerpEnds: false 701 | test('should not do lerpEnds of all colors if lerpEnds: false', () => { 702 | const result = lerpColors( 703 | { 704 | test1: { 705 | 100: '#f4f4f4', 706 | 200: '#f5f5f5', 707 | }, 708 | test2: { 709 | 100: '#f5f5f5', 710 | 300: '#f6f6f6', 711 | }, 712 | }, 713 | { 714 | lerpEnds: false, 715 | } 716 | ); 717 | 718 | expect(result.test1).toEqual( 719 | lerpColor( 720 | { 721 | 100: '#f4f4f4', 722 | 200: '#f5f5f5', 723 | }, 724 | { 725 | lerpEnds: false, 726 | } 727 | ) 728 | ); 729 | 730 | expect(result.test2).toEqual( 731 | lerpColor( 732 | { 733 | 100: '#f5f5f5', 734 | 300: '#f6f6f6', 735 | }, 736 | { 737 | lerpEnds: false, 738 | } 739 | ) 740 | ); 741 | }); 742 | }); 743 | 744 | // interval 745 | describe('interval', () => { 746 | // should use same interval for all colors 747 | describe('should use same interval for all colors', () => { 748 | [10, 25, 50, 100].forEach((interval) => { 749 | test(`test interval value: ${interval}`, () => { 750 | const result = lerpColors( 751 | { 752 | test1: { 753 | 100: '#f4f4f4', 754 | 200: '#f5f5f5', 755 | }, 756 | test2: { 757 | 100: '#f5f5f5', 758 | 300: '#f6f6f6', 759 | }, 760 | }, 761 | { 762 | lerpEnds: false, 763 | interval, 764 | } 765 | ); 766 | expect(Object.keys(result.test1)).toEqual( 767 | Object.keys( 768 | lerpColor( 769 | { 770 | 100: '#f4f4f4', 771 | 200: '#f5f5f5', 772 | }, 773 | { 774 | lerpEnds: false, 775 | interval, 776 | } 777 | ) 778 | ) 779 | ); 780 | expect(Object.keys(result.test2)).toEqual( 781 | Object.keys( 782 | lerpColor( 783 | { 784 | 100: '#f5f5f5', 785 | 300: '#f6f6f6', 786 | }, 787 | { 788 | lerpEnds: false, 789 | interval, 790 | } 791 | ) 792 | ) 793 | ); 794 | }); 795 | }); 796 | }); 797 | }); 798 | 799 | // modes 800 | describe('modes', () => { 801 | // should use same mode for all colors 802 | validColorModes.forEach((mode) => { 803 | test(`should use same mode for all colors if mode: ${mode}`, () => { 804 | const result = lerpColors( 805 | { 806 | test1: COLOR_MODES_MOCK_DATA[mode][0].input, 807 | test2: COLOR_MODES_MOCK_DATA[mode][1].input, 808 | test3: COLOR_MODES_MOCK_DATA[mode][2].input, 809 | }, 810 | { 811 | lerpEnds: false, 812 | mode, 813 | includeBase: false, 814 | } 815 | ); 816 | 817 | expect(result.test1).toEqual(COLOR_MODES_MOCK_DATA[mode][0].output); 818 | expect(result.test2).toEqual(COLOR_MODES_MOCK_DATA[mode][1].output); 819 | expect(result.test3).toEqual(COLOR_MODES_MOCK_DATA[mode][2].output); 820 | }); 821 | }); 822 | }); 823 | 824 | // colors 825 | describe('invalid formats in colors', () => { 826 | test('should not skip or modify non-object colors', () => { 827 | expect.assertions(3); 828 | const result = lerpColors( 829 | { 830 | test: '#000', 831 | testobj: { 832 | 100: '#ffffff', 833 | 200: '#f1f1f1', 834 | }, 835 | }, 836 | { 837 | includeBase: false, 838 | includeLegacy: false, 839 | lerpEnds: false, 840 | } 841 | ); 842 | 843 | expect(result.test).toBe('#000'); 844 | expect(result.testUndefined).toBeUndefined(); 845 | expect(Object.keys(result.testobj)).toEqual(['100', '125', '150', '175', '200']); 846 | }); 847 | 848 | test(`should not modify invalid format colors`, () => { 849 | const result = lerpColors( 850 | { 851 | testInvalid: { 852 | // @ts-ignore 853 | testString: '#ffffff', 854 | }, 855 | testValid: { 856 | 100: '#ffffff', 857 | 200: '#f1f1f1', 858 | }, 859 | }, 860 | { 861 | includeBase: false, 862 | includeLegacy: false, 863 | lerpEnds: false, 864 | interval: 50, 865 | } 866 | ); 867 | expect(result.testInvalid).toEqual({ 868 | testString: '#ffffff', 869 | }); 870 | 871 | expect(result.testValid).toEqual({ 872 | 100: '#ffffff', 873 | 150: '#f8f8f8', 874 | 200: '#f1f1f1', 875 | }); 876 | }); 877 | }); 878 | 879 | // defaulting 880 | describe('defaulting', () => { 881 | // should default to includeBase: true 882 | test('should default to includeBase: true', () => { 883 | const result = lerpColors( 884 | { 885 | test: { 886 | 100: '#ffffff', 887 | 200: '#f1f1f1', 888 | }, 889 | }, 890 | { 891 | includeLegacy: false, 892 | } 893 | ); 894 | 895 | expect(Object.keys(result)).toEqual([...validTailwindColorKeys.filter((v) => !legacyColors.includes(v)), 'test']); 896 | }); 897 | // shoudl default to includeLegacy: false 898 | test('should default to includeLegacy: false', () => { 899 | const result = lerpColors( 900 | { 901 | test: { 902 | 100: '#ffffff', 903 | 200: '#f1f1f1', 904 | }, 905 | }, 906 | { 907 | includeBase: true, 908 | } 909 | ); 910 | 911 | expect(Object.keys(result)).toEqual([...validTailwindColorKeys.filter((v) => !legacyColors.includes(v)), 'test']); 912 | }); 913 | 914 | // should default colors to empty object when not passed; 915 | test('should default colors to empty object when not passed', () => { 916 | const result = lerpColors(undefined, { 917 | includeBase: false, 918 | }); 919 | 920 | expect(Object.keys(result)).toEqual([]); 921 | }); 922 | 923 | // should default options to empty object when not passed; 924 | test('should default options to empty object when not passed', () => { 925 | const result = lerpColors( 926 | { 927 | test: { 928 | 100: '#ffffff', 929 | 200: '#f1f1f1', 930 | }, 931 | }, 932 | undefined 933 | ); 934 | 935 | expect(Object.keys(result)).toEqual([...validTailwindColorKeys.filter((k) => !legacyColors.includes(k)), 'test']); 936 | }); 937 | }); 938 | }); 939 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "skipLibCheck": true, 5 | "target": "es2022", 6 | "allowJs": true, 7 | "resolveJsonModule": true, 8 | "moduleDetection": "force", 9 | "isolatedModules": true, 10 | "strict": true, 11 | "noUncheckedIndexedAccess": true, 12 | "module": "NodeNext", 13 | "outDir": "dist", 14 | "sourceMap": true, 15 | "declaration": true, 16 | "lib": ["es2022"] 17 | } 18 | } 19 | --------------------------------------------------------------------------------