{"name":"hsluv","version":"1.0.2","keywords":["color","color space","CIE","RGB","HSL","HSLuv","HPLuv"],"author":{"name":"Alexei Boronine","email":"alexei@boronine.com"},"license":"MIT","_id":"hsluv@1.0.2","maintainers":[{"name":"boronine","email":"alexei@boronine.com"},{"name":"hsluvcontributors","email":"contributors@hsluv.org"}],"homepage":"https://www.hsluv.org","bugs":{"url":"https://github.com/hsluv/hsluv-javascript/issues"},"dist":{"shasum":"034c64d0ee232250b87eb38577a750bd186bc1fc","tarball":"http://registry-npm.ywwl.com/hsluv/download/hsluv-1.0.2.tgz","fileCount":6,"integrity":"sha512-HTYvUWwnkH63bzIWEz0wek//GCqSRv6Tqeo9RWhEvra3dVsjiPVIvPYZs7/LbCkEuR03lfJvqRyCSI5HXAMpqA==","signatures":[{"sig":"MEUCIGftgYs67AfYAWCFDsU468QQvlyC2EI1IYtwvIJaD4y1AiEApIBRTbnznItW7FFrs95sSRJi/jnd9uU1er2XWxGe3F8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/hsluv@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30826,"size":5790,"noattachment":false,"key":"/hsluv/-/hsluv-1.0.2.tgz"},"_from":"file:assets/hsluv-1.0.2.tgz","types":"dist/hsluv.d.ts","exports":{"types":"./dist/hsluv.d.ts","import":"./dist/hsluv.mjs","require":"./dist/hsluv.cjs"},"scripts":{"build":"sh build.sh"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b1ca4c84-d7c5-418c-b60e-58aa7f0bba10"}},"_resolved":"/home/runner/work/hsluv-javascript/hsluv-javascript/assets/hsluv-1.0.2.tgz","_integrity":"sha512-HTYvUWwnkH63bzIWEz0wek//GCqSRv6Tqeo9RWhEvra3dVsjiPVIvPYZs7/LbCkEuR03lfJvqRyCSI5HXAMpqA==","repository":{"url":"git+https://github.com/hsluv/hsluv-javascript.git","type":"git"},"_npmVersion":"11.13.0","description":"Human-friendly HSL","directories":{},"_nodeVersion":"24.16.0","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.1","typescript":"^5.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hsluv_1.0.2_1781453826869_0.17285775821625138","host":"s3://npm-registry-packages-npm-production"},"readme":"# HSLuv - Human-friendly HSL\n\n[![CI](https://github.com/hsluv/hsluv-javascript/actions/workflows/nodeci.yml/badge.svg)](https://github.com/hsluv/hsluv-javascript/actions/workflows/nodeci.yml)\n[![npm](https://img.shields.io/npm/v/hsluv)](https://www.npmjs.com/package/hsluv)\n\n## Installation\n\nInstall from NPM package repository:\n\n```bash\nnpm install hsluv\n```\n\nES modules:\n\n```javascript\nimport {Hsluv} from \"hsluv\";\n```\n\nCommonJS:\n\n```javascript\nconst {Hsluv} = require(\"hsluv\");\n```\n\nHTML include:\n\n- Download [the latest hsluv.min.js](https://github.com/hsluv/hsluv-javascript/releases)\n- Add `<script src=\"hsluv-x.x.x.min.js\"></script>` to your HTML\n- Access it via the global `window.Hsluv`\n\n## Usage\n\nThe API is designed to avoid heap allocation. The `HSLuv` class defines the following public fields:\n\n- RGB: `hex:String`, `rgb_r:Float` [0;1], `rgb_g:Float` [0;1], `rgb_r:Float` [0;1]\n- CIE XYZ: `xyz_x:Float`, `xyz_y:Float`, `xyz_z:Float`\n- CIE LUV: `luv_l:Float`, `luv_u:Float`, `luv_v:Float`\n- CIE LUV LCh: `lch_l:Float`, `lch_c:Float`, `lch_h:Float`\n- HSLuv: `hsluv_h:Float` [0;360], `hsluv_s:Float` [0;100], `hsluv_l:Float` [0;100]\n- HPLuv: `hpluv_h:Float` [0;360], `hpluv_p:Float` [0;100], `hpluv_l:Float` [0;100]\n\nTo convert between color spaces, simply set the properties of the source color space, run the\nconversion methods, then read the properties of the target color space.\n\nUse the following methods to convert to and from RGB:\n\n- HSLuv: `hsluvToRgb()`, `hsluvToHex()`, `rgbToHsluv()`, `hexToHsluv()`\n- HPLuv: `hpluvToRgb()`, `hpluvToHex()`, `rgbToHpluv()`, `hexToHpluv()`\n\nUse the following methods to do step-by-step conversion:\n\n- Forward: `hsluvToLch()` (or `hpluvToLch()`), `lchToLuv()`, `luvToXyz()`, `xyzToRgb()`, `rgbToHex()`\n- Backward: `hexToRgb()`, `rgbToXyz()`, `xyzToLuv()`, `luvToLch()`, `lchToHsluv()` (or `lchToHpluv()`)\n\nFor advanced usage, we also export the [bounding lines](https://www.hsluv.org/math/) in slope-intercept\nformat, two for each RGB channel representing the limit of the gamut.\n\n- R < 0: `r0s`, `r0i`\n- R > 1: `r1s`, `r1i`\n- G < 0: `g0s`, `g0i`\n- G > 1: `g1s`, `g1i`\n- B < 0: `b0s`, `b0i`\n- B > 1: `b1s`, `b1i`\n\nExample:\n\n```javascript\nvar conv = new Hsluv();\nconv.hsluv_h = 10;\nconv.hsluv_s = 75;\nconv.hsluv_l = 65;\nconv.hsluvToHex();\nconsole.log(conv.hex); // Will print \"#ec7d82\"\n```\n\nAlso available for [Stylus](http://stylus-lang.com/). See [here](https://github.com/hsluv/hsluv-stylus).\n\n## Development\n\nOur [Node.js CI workflow](https://github.com/hsluv/hsluv-javascript/blob/main/.github/workflows/nodeci.yml)\nwill build and test every push and PR to the `main` branch.\n\nTo publish a release, configure npm trusted publishing for the `hsluv/hsluv-javascript` repository and\n`npm-publish.yml` workflow, then create a GitHub Release. The release tag must match the version in\n`package.json`. The [Publish to npm workflow](https://github.com/hsluv/hsluv-javascript/blob/main/.github/workflows/npm-publish.yml)\nwill build the package and publish it to npm with provenance. Prerelease versions (for example `1.2.3-rc.1`)\nare automatically published with the matching npm dist-tag.\n\n## Changelog\n\n### 1.0.1\n\n- Fix TypeScript d.ts resolution for certain configurations.\n\n### 1.0.0\n\n- New API to avoid heap allocation.\n- Transpiled from [hsluv-haxe](https://github.com/hsluv/hsluv-haxe) and converted manually to TypeScript.\n- New GitHub Actions CI for build, test and publishing automation.\n\n### 0.1.0\n\n- Provide Typescript definitions in the NPM package.\n\n### 0.0.3\n\n- Expose intermediate functions in the public API.\n\n### 0.0.2\n\n- Improve packaging and minification.\n\n### 0.0.1\n\n- Initial release under the name HSLuv. Old releases can be found [here](https://www.npmjs.com/package/husl).\n","publish_time":1781453827017,"_cnpm_publish_time":1781453827017,"dist-tags":{"beta":"1.0.2-beta.0","latest":"1.0.2","rc":"1.0.1-rc1"}}