{"name":"@csstools/postcss-gamut-mapping","description":"Gamut map css colors to fit display specific gamuts","version":"2.0.6","contributors":[{"name":"Antonio Laguna","email":"antonio@laguna.es","url":"https://antonio.laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"license":"MIT-0","funding":[{"type":"github","url":"https://github.com/sponsors/csstools"},{"type":"opencollective","url":"https://opencollective.com/csstools"}],"engines":{"node":">=18"},"type":"module","main":"dist/index.cjs","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"default":"./dist/index.cjs"}}},"dependencies":{"@csstools/css-color-parser":"^3.0.6","@csstools/css-parser-algorithms":"^3.0.4","@csstools/css-tokenizer":"^3.0.3"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-gamut-mapping"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["color","css","display-p3","gamut mapping","p3","postcss","postcss-plugin","rec2020","srgb","wide gamut"],"_id":"@csstools/postcss-gamut-mapping@2.0.6","gitHead":"8e5a02282610a9275f4dd2787bbd286df2a11a79","types":"./dist/index.d.ts","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-0ke7fmXfc8H+kysZz246yjirAH6JFhyX9GTlyRnM0exHO80XcA9zeJpy5pOp5zo/AZiC/q5Pf+Hw7Pd6/uAoYA==","shasum":"04ec6a50fdbca2a30dec56e6bb780c79621e47a7","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-gamut-mapping/download/@csstools/postcss-gamut-mapping-2.0.6.tgz","fileCount":7,"unpackedSize":10154,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA4hWfY0FRyTJm2AQGbZG8VmVv9rm6tPeWOZGx48wQbCAiArcAuSLeVmjxgaWu5Ww6PSmMIcl+nit7Q08nSyH/HeJg=="}],"size":4073,"noattachment":false,"key":"/@csstools/postcss-gamut-mapping/-/@csstools/postcss-gamut-mapping-2.0.6.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-gamut-mapping_2.0.6_1731322896013_0.2649541750606832"},"_hasShrinkwrap":false,"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) {\np {\n\tcolor: oklch(20% 0.234 0.39 / 0.5);\n}\n}\n\n@media (color-gamut: p3) {\np {\n\tborder-color: color(display-p3 0 1 0);\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":1731322896167,"maintainers":[{"name":"romainmenke","email":"romainmenke@gmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"}],"_cnpm_publish_time":1731322896167,"dist-tags":{"latest":"3.0.17"}}