{"name":"color2k","version":"2.0.4","description":"a color parsing and manipulation lib served in roughly 2kB","repository":{"type":"git","url":"git+https://github.com/ricokahler/color2k.git"},"license":"MIT","author":{"name":"Rico Kahler","email":"ricokahler@me.com","url":"https://github.com/ricokahler"},"keywords":["color","css-in-js","tinycolor","color-parser","color-manipulation","polished","chroma-js"],"sideEffects":false,"main":"./dist/index.main.cjs.js","unpkg":"./dist/index.unpkg.umd.js","jsdelivr":"./dist/index.unpkg.umd.js","module":"./dist/index.module.es.js","types":"./dist/index.d.ts","exports":{".":[{"types":"./dist/index.d.ts","import":"./dist/index.exports.import.es.mjs","default":"./dist/index.exports.require.cjs.js"},"./dist/index.exports.require.cjs.js"],"./package.json":"./package.json"},"publishConfig":{"provenance":true},"scripts":{"build":"./scripts/build","audit:prod":"npm audit --omit=dev","check":"npm run lint && npm test -- --coverage && npm run build && npm run docs:check && npm run website && npm run website:check && npm run pack:check && npm run audit:prod","docs:check":"CHECK_DOCS=1 node ./scripts/docs.js","docs:generate":"node ./scripts/docs.js","lint":"eslint src --ext .ts,.js","pack:check":"npm run build && node ./scripts/check-package.js","prepare":"npm run build","test":"jest","website":"node ./scripts/website.js","website:check":"node ./scripts/check-website.js"},"devDependencies":{"@babel/core":"7.29.7","@babel/eslint-parser":"7.29.7","@babel/preset-env":"7.29.7","@babel/preset-typescript":"7.29.7","@babel/register":"7.29.7","@eslint/js":"9.39.4","@rollup/plugin-babel":"7.1.0","@rollup/plugin-node-resolve":"16.0.3","@types/jest":"30.0.0","eslint":"9.39.4","jest":"30.4.2","markdown-it":"14.3.0","prettier":"3.9.4","rollup":"4.62.2","semantic-release":"25.0.5","shiki":"4.3.1","typescript":"6.0.3"},"gitHead":"f996f1650ca8b177b3e1045141312d495857ae21","_id":"color2k@2.0.4","bugs":{"url":"https://github.com/ricokahler/color2k/issues"},"homepage":"https://github.com/ricokahler/color2k#readme","_nodeVersion":"24.18.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-OXAPGFRNeLFnUfqDtloYdxkwsJoIdXe28+bjbpJiPqyei2HPa3VHmMCWa0Qe62+U4Ftf9Hj7hRssOkxz7WiWbg==","shasum":"c874da1e6f089fcc32ef5ab0427e7ba7fe069d64","tarball":"http://registry-npm.ywwl.com/color2k/download/color2k-2.0.4.tgz","fileCount":37,"unpackedSize":343155,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/color2k@2.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDchG1JIu9Ka7Q5uJhXh61cRu9N+30eSnkYsUY1HBMiNwIgaRriZyQG6S4QBSUdAfp09MiqvB2srvbsSutuUGp4dtM="}],"size":72340,"noattachment":false,"key":"/color2k/-/color2k-2.0.4.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e814c5a5-180a-4823-961b-16bee6e2f105"}},"directories":{},"maintainers":[{"name":"ricokahler","email":"ricokahler@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/color2k_2.0.4_1783227615527_0.6431200520828035"},"_hasShrinkwrap":false,"readme":"# [🌈 color2k](https://color2k.com)\n\n[![bundlephobia](https://badgen.net/bundlephobia/minzip/color2k)](https://bundlephobia.com/result?p=color2k) [![github status checks](https://badgen.net/github/checks/ricokahler/color2k)](https://github.com/ricokahler/color2k/actions) [![codecov](https://codecov.io/gh/ricokahler/color2k/branch/master/graph/badge.svg)](https://codecov.io/gh/ricokahler/color2k) ![weekly downloads](https://badgen.net/npm/dw/color2k) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n> a color parsing and manipulation lib served in roughly 2kB or less (2.8kB to be more precise)\n\ncolor2k is a color parsing and manipulation library with the objective of keeping the bundle size as small as possible while still satisfying all of your color manipulation needs in an sRGB space.\n\nThe full bundle size is [currently 2.8kB](https://bundlephobia.com/result?p=color2k) but [gets as small as 2.1k](https://bundlejs.com/?q=color2k&treeshake=[{darken}]) with tree shaking.\n\n## Table of contents\n\n- [Size comparison](#size-comparison)\n- [Installation](#installation)\n- [Usage](#usage)\n- [How so small?](#how-so-small)\n- [Trust and publishing](#trust-and-publishing)\n- [Credits](#credits)\n- [API](#api)\n\n## Size comparison\n\n| lib                                                       | size                                                  |\n| --------------------------------------------------------- | ----------------------------------------------------- |\n| [chroma-js](https://github.com/gka/chroma.js)             | [13.7kB](https://bundlephobia.com/result?p=chroma-js) |\n| [polished](https://github.com/styled-components/polished) | [11.2kB](https://bundlephobia.com/result?p=polished)  |\n| [color](https://github.com/Qix-/color)                    | [7.6kB](https://bundlephobia.com/result?p=color)      |\n| [tinycolor2](https://github.com/bgrins/TinyColor)         | [5kB](https://bundlephobia.com/result?p=tinycolor2)   |\n| color2k                                                   | [2.8kB](https://bundlephobia.com/result?p=color2k) 😎 |\n\n👋 Compare tree-shaken bundle outputs on [bundlejs.com](https://bundlejs.com/?share=PTAEFcDsGMHsFt4FNIBdQENIBNRIB4AOsATuvLNuADZIDOoqsoc8hGJSjAFkgJYlQdPgC96oAFASQeIqXQAqUADMSCUACJo3NfAwBaAFZ0NAbmlgCxMqCWr1G4tT51e2MxdnXFK3ZrjUpB4yVvK2vg6ofJAAngGkAEweoTYA3tgcANYoAL4R8P6wgSQJmR5AA)\n\n## Installation\n\nInstall with a package manager such as `npm`\n\n```\nnpm i color2k\n```\n\n**OR** use with [skypack.dev](https://www.skypack.dev/) in supported environments (e.g. [deno](https://deno.land/manual/linking_to_external_code), [modern browsers](https://docs.skypack.dev/#whats-old-is-new-again)).\n\n```js\nimport { darken, transparentize } from 'https://cdn.skypack.dev/color2k?min';\n```\n\n## Usage\n\n```js\nimport { darken, transparentize } from 'color2k';\n\n// e.g.\ndarken('blue', 0.1);\ntransparentize('red', 0.5);\n```\n\n## How so small?\n\nThere are two secrets that keep this lib especially small:\n\n1. Simplicity — only handles basic color manipulation functions\n2. Less branching in code — only support two color models as outputs, namely `rgba` and `hsla`\n\n### Why only `rgba` and `hsla` as outputs?\n\nThis lib was created with the use case of CSS-in-JS in mind. At the end of the day, all that matters is that the browser can understand the color string you gave it as a `background-color`.\n\nBecause only those two color models are supported, we don't have to add code to deal with optional alpha channels or converting to non-browser supported color models (e.g. CMYK).\n\nWe believe that this lib is sufficient for all of your color manipulation needs. If we're missing a feature, feel free to [open an issue](https://github.com/ricokahler/color2k/issues/new) 😎.\n\n## Trust and publishing\n\ncolor2k is intentionally small and boring:\n\n- Zero runtime dependencies.\n- A narrow published package surface, limited to `dist`, `README.md`, `LICENSE`, and `package.json`.\n- npm provenance is configured through trusted publishing for release builds.\n- The README and docs site are generated from the JSDoc comments in `src/*.ts`.\n- Security issues can be reported through the process in [SECURITY.md](https://github.com/ricokahler/color2k/blob/main/SECURITY.md).\n\nBefore publishing, maintainers should run the checks in [docs/release-checklist.md](https://github.com/ricokahler/color2k/blob/main/docs/release-checklist.md).\n\n## Credits\n\nHeavy credit goes to polished.js and Sass. Much of the implementation of this lib is copied from polished.\n\n<!-- API-DOCS-START -->\n## API\n\nThis section is generated from the JSDoc comments in `src/*.ts`.\n\n### adjustHue(color, degrees)\n\n```ts\nfunction adjustHue(color: string, degrees: number): string\n```\n\nRotates a color's hue by the given number of degrees and returns the result\nas an `hsla` string. Hue values wrap around the 0 to 360 degree color wheel.\n\n```js\nadjustHue('red', 180); // 'hsla(180, 100%, 50%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `degrees` | `number` | The number of degrees to rotate the hue. |\n\n#### Returns\n\n`string` - The adjusted color as an `hsla` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/adjustHue.ts)\n\n### ColorError\n\n```ts\nclass ColorError extends Error\n```\n\nError thrown when color2k cannot parse an input color.\n\n```js\nnew ColorError('nope').message; // 'Failed to parse color: \"nope\"'\n```\n\n#### Constructor Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The color value that failed to parse. |\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/ColorError.ts)\n\n### darken(color, amount)\n\n```ts\nfunction darken(color: string, amount: number): string\n```\n\nDarkens a color by subtracting from the lightness channel in HSL space.\n\n```js\ndarken('white', 0.1); // 'hsla(0, 0%, 90%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `amount` | `number` | The amount to darken, given as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The darkened color as an `hsla` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/darken.ts)\n\n### desaturate(color, amount)\n\n```ts\nfunction desaturate(color: string, amount: number): string\n```\n\nDesaturates a color by subtracting from the saturation channel in HSL space.\n\n```js\ndesaturate('red', 0.5); // 'hsla(0, 50%, 50%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `amount` | `number` | The amount to desaturate, given as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The desaturated color as an `hsla` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/desaturate.ts)\n\n### getContrast(color1, color2)\n\n```ts\nfunction getContrast(color1: string, color2: string): number\n```\n\nReturns the contrast ratio between two colors based on the WCAG contrast\nratio formula.\n\n```js\ngetContrast('#444', '#fff'); // 9.739769120526205\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color1` | `string` | The first color. |\n| `color2` | `string` | The second color. |\n\n#### Returns\n\n`number` - The contrast ratio between the two colors.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/getContrast.ts)\n\n### getLuminance(color)\n\n```ts\nfunction getLuminance(color: string): number\n```\n\nReturns the relative luminance of a color using the WCAG formula.\n\n```js\ngetLuminance('papayawhip'); // 0.877971001998354\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n\n#### Returns\n\n`number` - A number between 0 for darkest black and 1 for lightest white.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/getLuminance.ts)\n\n### getScale(colors)\n\n```ts\nfunction getScale(colors: string[]): (n: number) => string\n```\n\nReturns a scale function that interpolates through a list of colors.\n\nThe returned function accepts a decimal between 0 and 1 and returns the color\nat that percentage in the scale.\n\n```js\nconst scale = getScale('red', 'yellow', 'green');\nconsole.log(scale(0)); // rgba(255, 0, 0, 1)\nconsole.log(scale(0.5)); // rgba(255, 255, 0, 1)\nconsole.log(scale(1)); // rgba(0, 128, 0, 1)\n```\n\nIf you'd like to limit the domain and range like chroma-js, we recommend\nwrapping scale again.\n\n```js\nconst _scale = getScale('red', 'yellow', 'green');\nconst scale = x => _scale(x / 100);\n\nconsole.log(scale(0)); // rgba(255, 0, 0, 1)\nconsole.log(scale(50)); // rgba(255, 255, 0, 1)\nconsole.log(scale(100)); // rgba(0, 128, 0, 1)\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `colors` | `string[]` | The colors to interpolate through. |\n\n#### Returns\n\n`(n: number) => string` - A function that maps a decimal percentage to an `rgba` color.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/getScale.ts)\n\n### guard(low, high, value)\n\n```ts\nfunction guard(low: number, high: number, value: number): number\n```\n\nClamps a number between a lower and upper bound.\n\n```js\nguard(0, 1, 2); // 1\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `low` | `number` | The lower bound. |\n| `high` | `number` | The upper bound. |\n| `value` | `number` | The number to clamp. |\n\n#### Returns\n\n`number` - The clamped number.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/guard.ts)\n\n### hasBadContrast(color, standard, background)\n\n```ts\nfunction hasBadContrast(color: string, standard: 'decorative' | 'readable' | 'aa' | 'aaa' = 'aa', background: string = '#fff'): boolean\n```\n\nReturns whether a color fails a contrast threshold against a background.\n\nThe supported standards are `decorative`, `readable`, `aa`, and `aaa`.\n\n```js\nhasBadContrast('red', 'aa'); // true\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The foreground color. |\n| `standard` | `'decorative' \\| 'readable' \\| 'aa' \\| 'aaa' = 'aa'` | The contrast standard to test against. |\n| `background` | `string = '#fff'` | The background color. |\n\n#### Returns\n\n`boolean` - `true` when the contrast ratio is below the selected standard.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/hasBadContrast.ts)\n\n### hsla(hue, saturation, lightness, alpha)\n\n```ts\nfunction hsla(hue: number, saturation: number, lightness: number, alpha: number): string\n```\n\nBuilds an `hsla` color string from hue, saturation, lightness, and alpha\nchannel values.\n\n```js\nhsla(0, 1, 0.5, 1); // 'hsla(0, 100%, 50%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `hue` | `number` | The color wheel angle from 0 to 360. |\n| `saturation` | `number` | The saturation as a decimal between 0 and 1. |\n| `lightness` | `number` | The lightness as a decimal between 0 and 1. |\n| `alpha` | `number` | The opacity as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - An `hsla` color string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/hsla.ts)\n\n### lighten(color, amount)\n\n```ts\nfunction lighten(color: string, amount: number): string\n```\n\nLightens a color by adding to the lightness channel in HSL space.\n\nThis is equivalent to `darken(color, -amount)`.\n\n```js\nlighten('black', 0.1); // 'hsla(0, 0%, 10%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `amount` | `number` | The amount to lighten, given as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The lightened color as an `hsla` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/lighten.ts)\n\n### mix(color1, color2, weight)\n\n```ts\nfunction mix(color1: string, color2: string, weight: number): string\n```\n\nMixes two colors together using the Sass mix algorithm and returns an `rgba`\ncolor string.\n\n```js\nmix('red', 'blue', 0.5); // 'rgba(128, 0, 128, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color1` | `string` | The first color. |\n| `color2` | `string` | The second color. |\n| `weight` | `number` | The mix weight as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The mixed color as an `rgba` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/mix.ts)\n\n### opacify(color, amount)\n\n```ts\nfunction opacify(color: string, amount: number): string\n```\n\nMakes a color more opaque by increasing the alpha channel.\n\nThis is equivalent to `transparentize(color, -amount)`.\n\n```js\nopacify('rgba(255, 255, 255, 0.5)', 0.1); // 'rgba(255, 255, 255, 0.6)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `amount` | `number` | The amount to increase opacity by, given as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The more opaque color as an `rgba` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/opacify.ts)\n\n### parseToHsla(color)\n\n```ts\nfunction parseToHsla(color: string): [number, number, number, number]\n```\n\nParses a color into hue, saturation, lightness, and alpha channel values.\n\nHue is a number between 0 and 360. Saturation, lightness, and alpha are\ndecimal percentages between 0 and 1.\n\n```js\nparseToHsla('red'); // [0, 1, 0.5, 1]\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n\n#### Returns\n\n`[number, number, number, number]` - A tuple of hue, saturation, lightness, and alpha values.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/parseToHsla.ts)\n\n### parseToRgba(color)\n\n```ts\nfunction parseToRgba(color: string): [number, number, number, number]\n```\n\nParses a color into red, green, blue, and alpha channel values.\n\nSupports hex, RGB, RGBA, HSL, HSLA, CSS named colors, and `transparent`.\n\n```js\nparseToRgba('rgba(255, 0, 0, 0.5)'); // [255, 0, 0, 0.5]\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n\n#### Returns\n\n`[number, number, number, number]` - A tuple of red, green, blue, and alpha channel values.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/parseToRgba.ts)\n\n### readableColor(color)\n\n```ts\nfunction readableColor(color: string): string\n```\n\nReturns black or white, whichever has better contrast against the given\ncolor.\n\n```js\nreadableColor('white'); // '#000'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The background color. |\n\n#### Returns\n\n`string` - `#000` or `#fff`.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/readableColor.ts)\n\n### readableColorIsBlack(color)\n\n```ts\nfunction readableColorIsBlack(color: string): boolean\n```\n\nReturns whether black is the more readable color to place on top of the\ninput color.\n\nThis is the boolean form of `readableColor`.\n\n```js\nreadableColorIsBlack('white'); // true\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The background color. |\n\n#### Returns\n\n`boolean` - `true` when black is the more readable foreground color.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/readableColorIsBlack.ts)\n\n### rgba(red, green, blue, alpha)\n\n```ts\nfunction rgba(red: number, green: number, blue: number, alpha: number): string\n```\n\nBuilds an `rgba` color string from red, green, blue, and alpha channel\nvalues.\n\n```js\nrgba(255, 0, 0, 1); // 'rgba(255, 0, 0, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `red` | `number` | The red channel value from 0 to 255. |\n| `green` | `number` | The green channel value from 0 to 255. |\n| `blue` | `number` | The blue channel value from 0 to 255. |\n| `alpha` | `number` | The opacity as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - An `rgba` color string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/rgba.ts)\n\n### saturate(color, amount)\n\n```ts\nfunction saturate(color: string, amount: number): string\n```\n\nSaturates a color by adding to the saturation channel in HSL space.\n\nThis is equivalent to `desaturate(color, -amount)`.\n\n```js\nsaturate('hsl(0, 50%, 50%)', 0.1); // 'hsla(0, 60%, 50%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `amount` | `number` | The amount to saturate, given as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The saturated color as an `hsla` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/saturate.ts)\n\n### toHex(color)\n\n```ts\nfunction toHex(color: string): string\n```\n\nConverts a color to a hex color string.\n\nIncludes an alpha channel when the input color is not fully opaque.\n\n```js\ntoHex('palevioletred'); // '#db7093'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n\n#### Returns\n\n`string` - A hex color string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/toHex.ts)\n\n### toHsla(color)\n\n```ts\nfunction toHsla(color: string): string\n```\n\nConverts a color to an `hsla` color string.\n\n```js\ntoHsla('peachpuff'); // 'hsla(28, 100%, 86%, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n\n#### Returns\n\n`string` - An `hsla` color string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/toHsla.ts)\n\n### toRgba(color)\n\n```ts\nfunction toRgba(color: string): string\n```\n\nConverts a color to an `rgba` color string.\n\n```js\ntoRgba('midnightblue'); // 'rgba(25, 25, 112, 1)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n\n#### Returns\n\n`string` - An `rgba` color string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/toRgba.ts)\n\n### transparentize(color, amount)\n\n```ts\nfunction transparentize(color: string, amount: number): string\n```\n\nMakes a color more transparent by decreasing the alpha channel.\n\n```js\ntransparentize('white', 0.1); // 'rgba(255, 255, 255, 0.9)'\n```\n\n#### Parameters\n\n| Name | Type | Description |\n| --- | --- | --- |\n| `color` | `string` | The input color. |\n| `amount` | `number` | The amount to increase transparency by, given as a decimal between 0 and 1. |\n\n#### Returns\n\n`string` - The more transparent color as an `rgba` string.\n\n[Source](https://github.com/ricokahler/color2k/blob/main/src/transparentize.ts)\n<!-- API-DOCS-END -->\n","publish_time":1783227615688,"_cnpm_publish_time":1783227615688,"dist-tags":{"alpha":"1.2.0-alpha.3","latest":"2.0.4"}}