{"_id":"vue3-color-gradient-picker","_rev":"4-e302ff5c64a2477b8552e33d6499f702","name":"vue3-color-gradient-picker","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"vue3-color-gradient-picker","version":"1.0.0","_id":"vue3-color-gradient-picker@1.0.0","maintainers":[{"name":"bamzc","email":"bamzc@hotmail.com"}],"dist":{"shasum":"c116b62a557023102f20d7a2e6ba1846f18d5a32","tarball":"https://registry.npmjs.org/vue3-color-gradient-picker/-/vue3-color-gradient-picker-1.0.0.tgz","fileCount":7,"integrity":"sha512-CWF1uR0Tds8F8NTs3TZ0V8hUgyalbqagGGuHPq8k/4/3zqvj/ubdeEA4TZRrOVHqicLO0Qg0DhsvxWv2QQ6TTw==","signatures":[{"sig":"MEUCIQCo7lv5p7Gs+cxDgFqXnZeHYPArPOMY4tmp9YOyZubnPAIgawK6olixhmjaQLkhSggNtLG4gi+GH4XHrcJq/++ySGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":84822},"main":"./dist/index.js.mjs","style":"./dist/style.css","module":"./dist/index.js.mjs","browser":"./dist/index-umd.js.umd.js","scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore","build":"vite build","format":"prettier --write src/","preview":"vite preview"},"_npmUser":{"name":"bamzc","email":"bamzc@hotmail.com"},"_npmVersion":"8.15.0","description":"<!--  * @Author: bamzc  * @Date: 2023-08-16 10:02:22  * @LastEditors: bamzc  * @LastEditTime: 2023-08-16 10:11:22  * @Description:  -->","directories":{},"_nodeVersion":"16.17.0","dependencies":{"vue":"^3.3.4"},"_hasShrinkwrap":false,"devDependencies":{"sass":"^1.65.1","vite":"^4.4.6","eslint":"^8.45.0","prettier":"^3.0.0","@types/node":"^20.4.9","eslint-plugin-vue":"^9.15.1","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@rushstack/eslint-patch":"^1.3.2","@vue/eslint-config-prettier":"^8.0.0","cb-vue-color-gradient-picker":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vue3-color-gradient-picker_1.0.0_1692152227032_0.2907303701037145","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"vue3-color-gradient-picker","version":"1.0.1","keywords":["vue","vue.js","vue3","color-picker","picker","gradient"],"author":{"name":"bamzc"},"license":"MIT","_id":"vue3-color-gradient-picker@1.0.1","maintainers":[{"name":"bamzc","email":"bamzc@hotmail.com"}],"homepage":"https://github.com/Bamzc/vue3-color-gradient-picker.git#readme","bugs":{"url":"https://github.com/Bamzc/vue3-color-gradient-picker.git/issues"},"dist":{"shasum":"ef84344f557df8ff3774594ece1bddc95dd9dd41","tarball":"https://registry.npmjs.org/vue3-color-gradient-picker/-/vue3-color-gradient-picker-1.0.1.tgz","fileCount":7,"integrity":"sha512-EqS9zThMVABG99EmWpSFNqW+e7/GQrw/876lJRYbvpGehnf+qiR0sNIXj2SdHzlvGkkOg61Xq//qiIw6UUobCA==","signatures":[{"sig":"MEUCIHYVHB5CHF21wiFqD4ookHdCCWRfUIdW/fljDZcbk1gDAiEAqbEu2g/2YC8UUOtYyGnuys++IJBPQML+T0MoCHLWCFA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85290},"main":"./dist/index.js.mjs","tags":["vue","vue.js","vue3","color-picker","gradient"],"style":"./dist/style.css","module":"./dist/index.js.mjs","browser":"./dist/index-umd.js.umd.js","scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore","build":"vite build","format":"prettier --write src/","preview":"vite preview"},"_npmUser":{"name":"bamzc","email":"bamzc@hotmail.com"},"repository":{"url":"git+https://github.com/Bamzc/vue3-color-gradient-picker.git.git","type":"git"},"_npmVersion":"8.15.0","description":"Color and gradient picker for vue3.js","directories":{},"_nodeVersion":"16.17.0","dependencies":{"vue":"^3.3.4"},"_hasShrinkwrap":false,"devDependencies":{"sass":"^1.65.1","vite":"^4.4.6","eslint":"^8.45.0","prettier":"^3.0.0","@types/node":"^20.4.9","eslint-plugin-vue":"^9.15.1","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@rushstack/eslint-patch":"^1.3.2","@vue/eslint-config-prettier":"^8.0.0","cb-vue-color-gradient-picker":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vue3-color-gradient-picker_1.0.1_1692153636041_0.01214450940247258","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"vue3-color-gradient-picker","version":"1.0.2","keywords":["vue","vue.js","vue3","color-picker","picker","gradient"],"author":{"name":"bamzc"},"license":"MIT","_id":"vue3-color-gradient-picker@1.0.2","maintainers":[{"name":"bamzc","email":"bamzc@hotmail.com"}],"homepage":"https://github.com/Bamzc/vue3-color-gradient-picker.git#readme","bugs":{"url":"https://github.com/Bamzc/vue3-color-gradient-picker.git/issues"},"dist":{"shasum":"93bffbf89cf1105b9a67f16cb9797c08f2be27d6","tarball":"https://registry.npmjs.org/vue3-color-gradient-picker/-/vue3-color-gradient-picker-1.0.2.tgz","fileCount":7,"integrity":"sha512-ef9TgGjYFh6P3qPsF0hXLo2lzQDCz8glHqP8cXJ1JBozqUvsqD48eGbAxXWH39LFgDCYNyqjk18gb9aDKOwMYQ==","signatures":[{"sig":"MEYCIQCVBoNovN3tfLr9A41qlJGzSrTgV4HWmP+j2C6pEnJoHAIhAJIBosS+Ow6Z5TyfosnzVm9li1g16vOkYrHt/q1mnHxa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86923},"main":"./dist/index.js.mjs","tags":["vue","vue.js","vue3","color-picker","gradient"],"style":"./dist/style.css","module":"./dist/index.js.mjs","browser":"./dist/index-umd.js.umd.js","gitHead":"6e731363f4df7f8f1578dd4ec57e3107fe389dba","scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore","build":"vite build","format":"prettier --write src/","preview":"vite preview"},"_npmUser":{"name":"bamzc","email":"bamzc@hotmail.com"},"repository":{"url":"git+https://github.com/Bamzc/vue3-color-gradient-picker.git.git","type":"git"},"_npmVersion":"8.15.0","description":"Color and gradient picker for vue3.js","directories":{},"_nodeVersion":"16.17.0","dependencies":{"vue":"^3.3.4"},"_hasShrinkwrap":false,"devDependencies":{"sass":"^1.65.1","vite":"^4.4.6","eslint":"^8.45.0","prettier":"^3.0.0","@types/node":"^20.4.9","eslint-plugin-vue":"^9.15.1","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@rushstack/eslint-patch":"^1.3.2","@vue/eslint-config-prettier":"^8.0.0","cb-vue-color-gradient-picker":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vue3-color-gradient-picker_1.0.2_1705906354683_0.6198174394903604","host":"s3://npm-registry-packages"}},"1.0.3":{"_id":"vue3-color-gradient-picker@1.0.3","bugs":{"url":"https://github.com/bamzc/vue3-color-gradient-picker/issues"},"dist":{"shasum":"58846c048b96f50bb137c36622f13a1e5b4c108c","tarball":"https://registry.npmjs.org/vue3-color-gradient-picker/-/vue3-color-gradient-picker-1.0.3.tgz","fileCount":7,"integrity":"sha512-2BQLe0QtApZasJyexEvjBTLBqa2Z7adTZO7iBsNqN8oXtlk+Haig2nvn78+ugw6vrofCdVoXvCfHR0fQ+Hc8Zw==","signatures":[{"sig":"MEQCIB/+FA2MoFWU/IH9s2kG2emo45g3yk1StK4h6tLdkyclAiBOtK6WQk/yJr7KgSYAIOWGk6ZCsZ6Dt45d/KIaqhIr1Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIA7kPLBR1HpjdGvUwXhi+FT5EU0GR1uJ+DbxfNjjoXyxAiBx35SH+YbJENmi3tTf95DQ8CVSkBei5l02+3wKnlt26A=="}],"unpackedSize":90568},"main":"./dist/index.js.mjs","name":"vue3-color-gradient-picker","tags":["vue","vue.js","vue3","color-picker","gradient"],"style":"./dist/style.css","author":{"name":"bamzc"},"module":"./dist/index.js.mjs","gitHead":"1e6485c593a66dc65c16c9342acd8c04fb2b196f","license":"MIT","scripts":{"dev":"vite","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore","build":"vite build","format":"prettier --write src/","preview":"vite preview"},"version":"1.0.3","_npmUser":{"name":"bamzc","email":"bamzc@hotmail.com"},"homepage":"https://github.com/bamzc/vue3-color-gradient-picker#readme","keywords":["vue","vue.js","vue3","color-picker","picker","gradient"],"repository":{"url":"git+https://github.com/bamzc/vue3-color-gradient-picker.git","type":"git"},"_npmVersion":"11.16.0","description":"Color and gradient picker for vue3.js","directories":{},"maintainers":[{"name":"bamzc","email":"bamzc@hotmail.com"}],"_nodeVersion":"24.18.0","dependencies":{"vue":"^3.3.4"},"_hasShrinkwrap":false,"devDependencies":{"sass":"^1.65.1","vite":"^4.4.6","eslint":"^8.45.0","prettier":"^3.0.0","@types/node":"^20.4.9","eslint-plugin-vue":"^9.15.1","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@rushstack/eslint-patch":"^1.3.2","@vue/eslint-config-prettier":"^8.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vue3-color-gradient-picker_1.0.3_1793078698545_0.24502351366827546"}}},"time":{"created":"2023-08-16T02:17:07.031Z","modified":"2026-10-27T05:24:59.950Z","1.0.0":"2023-08-16T02:17:07.199Z","1.0.1":"2023-08-16T02:40:36.284Z","1.0.2":"2024-01-22T06:52:34.852Z","1.0.3":"2026-10-27T05:24:58.639Z"},"bugs":{"url":"https://github.com/bamzc/vue3-color-gradient-picker/issues"},"author":{"name":"bamzc"},"license":"MIT","homepage":"https://github.com/bamzc/vue3-color-gradient-picker#readme","keywords":["vue","vue.js","vue3","color-picker","picker","gradient"],"repository":{"url":"git+https://github.com/bamzc/vue3-color-gradient-picker.git","type":"git"},"description":"Color and gradient picker for vue3.js","maintainers":[{"name":"bamzc","email":"bamzc@hotmail.com"}],"readme":"# vue3-color-gradient-picker\n\n[![npm](https://badgen.net/npm/v/vue3-color-gradient-picker)](https://www.npmjs.com/package/vue3-color-gradient-picker)\n[![downloads](https://badgen.net/npm/dt/vue3-color-gradient-picker)](https://www.npmjs.com/package/vue3-color-gradient-picker)\n[![license](https://badgen.net/npm/license/vue3-color-gradient-picker)](./license)\n\nA color and gradient picker component for Vue 3.\n\n![vue3-color-gradient-picker](https://raw.githubusercontent.com/bamzc/vue3-color-gradient-picker/main/image.png)\n\n## Features\n\n- Solid color picking with saturation / value area, hue slider and alpha slider\n- Linear and radial gradients with any number of color stops\n- Adjustable gradient angle by dragging the dial or clicking it to rotate 45°\n- HEX (including 8-digit `#RRGGBBAA`) and RGBA inputs\n- Start / change / end callbacks with a ready-to-use CSS value\n\n## Installation\n\n```bash\nnpm install vue3-color-gradient-picker\n# or\nyarn add vue3-color-gradient-picker\n# or\npnpm add vue3-color-gradient-picker\n```\n\nRequires Vue 3.3 or later.\n\n## Usage\n\nImport the component and its stylesheet:\n\n```js\nimport { ColorPicker } from 'vue3-color-gradient-picker';\nimport 'vue3-color-gradient-picker/dist/style.css';\n```\n\n### Solid color\n\n```vue\n<script setup>\nimport { ref } from 'vue';\nimport { ColorPicker } from 'vue3-color-gradient-picker';\nimport 'vue3-color-gradient-picker/dist/style.css';\n\nconst color = ref({ red: 255, green: 0, blue: 0, alpha: 1 });\n\nfunction onChange(value) {\n  color.value = { ...value };\n  console.log(value.style); // rgba(255, 0, 0, 1)\n}\n</script>\n\n<template>\n  <ColorPicker :color=\"color\" :onChange=\"onChange\" />\n</template>\n```\n\n### Gradient\n\n```vue\n<script setup>\nimport { ColorPicker } from 'vue3-color-gradient-picker';\nimport 'vue3-color-gradient-picker/dist/style.css';\n\nconst gradient = {\n  type: 'linear',\n  degree: 90,\n  points: [\n    { left: 0, red: 0, green: 0, blue: 0, alpha: 1 },\n    { left: 100, red: 255, green: 0, blue: 0, alpha: 1 },\n  ],\n};\n\nfunction onChange(value) {\n  console.log(value.style); // linear-gradient(90deg,rgba(0, 0, 0, 1) 0%,rgba(255, 0, 0, 1) 100%)\n}\n</script>\n\n<template>\n  <ColorPicker is-gradient :gradient=\"gradient\" :onChange=\"onChange\" />\n</template>\n```\n\nGradient interactions:\n\n| Action | Result |\n| --- | --- |\n| Click the gradient bar | Add a color stop at that position |\n| Drag a color stop | Move the stop |\n| Double-click a stop, or press `Delete` / `Backspace` | Remove the active stop (at least two stops are kept) |\n| Click the angle dial | Rotate the linear gradient by 45° |\n| Drag the angle dial | Set the angle freely |\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `isGradient` | `Boolean` | `false` | Show the gradient picker instead of the solid color picker |\n| `color` | `Object` | `{ red: 255, green: 0, blue: 0, alpha: 1 }` | Solid color. `red` / `green` / `blue` range from 0 to 255, `alpha` from 0 to 1. Optional `hue`, `saturation` and `value` can be passed to keep the HSV position exact |\n| `gradient` | `Object` | Black to red, linear, 0° | Initial gradient, see the structure below. It is read when the component is mounted |\n| `onStartChange` | `Function` | — | Called when a drag starts |\n| `onChange` | `Function` | — | Called on every change |\n| `onEndChange` | `Function` | — | Called when a drag ends |\n\nGradient structure:\n\n```js\n{\n  type: 'linear', // 'linear' | 'radial'\n  degree: 90,     // angle of the linear gradient, 0 - 360\n  points: [\n    // left: position of the stop in percent, 0 - 100\n    { left: 0, red: 0, green: 0, blue: 0, alpha: 1 },\n    { left: 100, red: 255, green: 0, blue: 0, alpha: 1 },\n  ],\n}\n```\n\n## Callback value\n\nSolid mode:\n\n```js\n{ red, green, blue, alpha, hue, saturation, value, style } // style: 'rgba(r, g, b, a)'\n```\n\nGradient mode:\n\n```js\n{ points, type, degree, style } // style: a CSS linear-gradient() / radial-gradient() value\n```\n\nAdding or removing a stop and changing the gradient type or angle only trigger `onChange`. To persist the gradient, listen to `onChange`.\n\n## Styles\n\nThe stylesheet must be imported manually from `vue3-color-gradient-picker/dist/style.css`. Note that it applies `box-sizing: border-box` to all elements on the page.\n\n## Development\n\n```bash\nnpm install\nnpm run dev    # start the demo with hot reload\nnpm run build  # build the library into dist/\nnpm run lint\n```\n\n## Changelog\n\n### 1.0.3\n\n- Fixed pointer offsets when the page is scrolled\n- Fixed the picker not working when mounted inside a hidden container, such as a popover or dialog\n- Fixed a small offset when clicking the hue and alpha sliders\n- Fixed the angle dial calculating a wrong angle\n- Fixed `Delete` / `Backspace` removing gradient stops while typing in an input\n- Fixed the keyboard listener not being removed when the component is unmounted\n- Fixed the active color not updating after a gradient stop is removed\n- Fixed 8-digit HEX input setting alpha to 0\n- Limited the alpha input to 0 - 100\n- Removed the invalid `browser` field from `package.json`\n\n## License\n\n[MIT](./license) © Bamzc\n","readmeFilename":"README.md"}