{"_id":"@csstools/postcss-gamut-mapping@3.0.17","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"063c81b62bf5c8afe196cf9e23ef8bb454ec78e5","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-gamut-mapping/download/@csstools/postcss-gamut-mapping-3.0.17.tgz","fileCount":6,"integrity":"sha512-qWOkHhEPwPZUdpK8lnuIH1ir1u4N2Uzaobif8cG0RMzzGv8cC74ed3u8dzlx9BRJVWFCef5GhfSCMqfG0BZAsw==","signatures":[{"sig":"MEUCIC3t9xIKYCsXaZAj1mWu8gBx1g6W0qHlO8NomAYaWzL1AiEAh5nwQ8NWHJbtI/rDghGR4sBmBsSPHhEHu16mqaVJfm4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDwzOlbufgCAscwl+boaWh35GxNWdZvvT9Le4DTUdRJfAIhAOUJ2bSWdvRTQYNbg3A4y8AywHmHx40ncHZgrujTeA2N"}],"unpackedSize":10000,"size":4186,"noattachment":false,"key":"/@csstools/postcss-gamut-mapping/-/@csstools/postcss-gamut-mapping-3.0.17.tgz"},"name":"@csstools/postcss-gamut-mapping","type":"module","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"}},"funding":[{"url":"https://github.com/sponsors/csstools","type":"github"},{"url":"https://opencollective.com/csstools","type":"opencollective"}],"gitHead":"f3c509c318b1c2ba86479f4d6c312715b9c30ebb","license":"MIT-0","scripts":{},"version":"3.0.17","_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping#readme","keywords":["color","css","display-p3","gamut","gamut-mapping","p3","postcss","postcss-plugin","rec2020","srgb","wide-gamut"],"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-gamut-mapping"},"_npmVersion":"11.13.0","description":"Gamut map css colors to fit display specific gamuts","directories":{},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_nodeVersion":"26.1.0","contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"dependencies":{"@csstools/css-tokenizer":"^4.0.3","@csstools/css-color-parser":"^4.2.8","@csstools/css-parser-algorithms":"^4.0.3"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-gamut-mapping_3.0.17_1794922745556_0.02580140342591608"},"readme":"# PostCSS Gamut Mapping [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n`npm install @csstools/postcss-gamut-mapping --save-dev`\n\n[PostCSS Gamut Mapping] lets you use wide gamut colors with gamut mapping for specific displays following the [CSS Color 4 Specification].\n\nWhen out of gamut colors are naively clipped the result can be radically different.  \nA saturated and bright color will be much darker after clipping.\n\nTo correctly adjust colors for a narrow gamut display, the colors must be mapped.  \nThis is done by lowering the `chroma` in `oklch` until the color is in gamut.  \n\nUsing the `@media (color-gamut)` media feature makes it possible to only use the wide gamut colors on displays that support them.\n\n```css\np {\n\tbackground-color: oklch(80% 0.05 0.39 / 0.5);\n\tcolor: oklch(20% 0.234 0.39 / 0.5);\n\tborder-color: color(display-p3 0 1 0);\n}\n\n/* becomes */\n\np {\n\tbackground-color: oklch(80% 0.05 0.39 / 0.5);\n\tcolor: rgba(48, 0, 20, 0.5);\n\tborder-color: rgb(0, 247, 79);\n}\n\n@media (color-gamut: rec2020) {\n\n@supports (color: oklab(0% 0 0%)) {\np {\n\tcolor: oklch(20% 0.234 0.39 / 0.5);\n}\n}\n}\n\n@media (color-gamut: p3) {\n\n@supports (color: color(display-p3 0 0 0%)) {\np {\n\tborder-color: color(display-p3 0 1 0);\n}\n}\n}\n```\n\n## Usage\n\nAdd [PostCSS Gamut Mapping] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-gamut-mapping --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssGamutMapping = require('@csstools/postcss-gamut-mapping');\n\npostcss([\n\tpostcssGamutMapping(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#gamut-mapping\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-gamut-mapping\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Gamut Mapping]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping\n[CSS Color 4 Specification]: https://www.w3.org/TR/css-color-4/#gamut-mapping\n","publish_time":1794922745668,"_cnpm_publish_time":1794922745668,"dist-tags":{"latest":"3.0.17"}}