pickit-color 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +44 -0
- package/README.md +170 -0
- package/dist/colorpicker.css +881 -0
- package/dist/colorpicker.js +929 -0
- package/dist/colorpicker.min.css +1 -0
- package/dist/colorpicker.min.js +2 -0
- package/dist/esm/index.js +820 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/index.d.ts +79 -0
- package/package.json +69 -0
- package/src/README.md +292 -0
- package/src/colorpicker.d.ts +52 -0
- package/src/colorpicker.styl +719 -0
- package/src/index.ts +1181 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Donationware License
|
|
2
|
+
|
|
3
|
+
**Pickit Color** © 2026 Thomas Skerbis (KLXM Crossmedia)
|
|
4
|
+
|
|
5
|
+
## Terms of Use
|
|
6
|
+
|
|
7
|
+
This software is provided as **Donationware**. You are free to:
|
|
8
|
+
|
|
9
|
+
- ✅ Use this software for personal projects
|
|
10
|
+
- ✅ Use this software for commercial projects
|
|
11
|
+
- ✅ Modify the source code for your needs
|
|
12
|
+
- ✅ Distribute modified versions (with attribution)
|
|
13
|
+
|
|
14
|
+
## Support Development
|
|
15
|
+
|
|
16
|
+
While this software is free to use, its development takes time and effort. If you find Pickit Color useful, please consider supporting its continued development:
|
|
17
|
+
|
|
18
|
+
**💖 [Sponsor on GitHub](https://github.com/sponsors/skerbis)**
|
|
19
|
+
|
|
20
|
+
Your support helps:
|
|
21
|
+
- 🐛 Bug fixes and maintenance
|
|
22
|
+
- ✨ New features and improvements
|
|
23
|
+
- 📚 Better documentation
|
|
24
|
+
- 🔒 Security updates
|
|
25
|
+
|
|
26
|
+
## Attribution
|
|
27
|
+
|
|
28
|
+
When using this software, please keep the following attribution in your project:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Powered by Pickit Color by Thomas Skerbis
|
|
32
|
+
https://github.com/skerbis/pickit-color
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Warranty Disclaimer
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
**Author**: Thomas Skerbis
|
|
42
|
+
**Organization**: KLXM Crossmedia
|
|
43
|
+
**GitHub**: https://github.com/skerbis
|
|
44
|
+
**Sponsor**: https://github.com/sponsors/skerbis
|
package/README.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# 🎨 Pickit Color
|
|
2
|
+
|
|
3
|
+
A modern, lightweight, and accessible color picker with HSL/RGBA support, preset colors, multiple UI modes, and screen color picking capabilities.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/sponsors/skerbis)
|
|
6
|
+
[](LICENSE.md)
|
|
7
|
+
|
|
8
|
+
## ✨ Features
|
|
9
|
+
|
|
10
|
+
- 🎯 **Multiple Color Formats**: HEX, HEX8, RGB, RGBA, HSL, HSLA
|
|
11
|
+
- 🎚️ **Slider Mode**: Individual sliders for H, S, L, A values
|
|
12
|
+
- 🎨 **2D Picker**: Traditional saturation/lightness picker
|
|
13
|
+
- 📌 **Preset Colors**: With optional labels and list view
|
|
14
|
+
- 👁️ **Screen Color Picker**: EyeDropper API + System ColorPicker fallback
|
|
15
|
+
- 🔲 **Compact Mode**: Minimal button interface
|
|
16
|
+
- 📍 **Inline Mode**: Always-visible picker
|
|
17
|
+
- 🖼️ **Input Preview**: Color square inside input field
|
|
18
|
+
- 🌙 **Dark Mode**: Automatic dark theme support
|
|
19
|
+
- ♿ **Accessibility**: WCAG 2.1 AA compliant with full keyboard navigation
|
|
20
|
+
- 📦 **Lightweight**: ~15 KB minified
|
|
21
|
+
|
|
22
|
+
## 📦 Installation
|
|
23
|
+
|
|
24
|
+
### NPM
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install pickit-color
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### CDN
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pickit-color/dist/colorpicker.min.css">
|
|
34
|
+
<script src="https://cdn.jsdelivr.net/npm/pickit-color/dist/colorpicker.min.js"></script>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 🚀 Quick Start
|
|
38
|
+
|
|
39
|
+
### HTML Attribute (Auto-Init)
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<input
|
|
43
|
+
type="text"
|
|
44
|
+
data-colorpicker="format:hex,showAlpha:true"
|
|
45
|
+
value="#3b82f6"
|
|
46
|
+
>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### JavaScript
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
import colorpicker from 'pickit-color';
|
|
53
|
+
|
|
54
|
+
const picker = colorpicker('#myInput', {
|
|
55
|
+
format: 'hex',
|
|
56
|
+
showAlpha: true,
|
|
57
|
+
onChange: (color) => {
|
|
58
|
+
console.log('Selected color:', color);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 📖 Examples
|
|
64
|
+
|
|
65
|
+
### Standard Picker
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<input data-colorpicker="format:hex" value="#3b82f6">
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Slider Mode (Individual H, S, L, A Sliders)
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<input data-colorpicker="format:hsl,sliderMode:true,showAlpha:true">
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### With Preset Colors
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<input
|
|
81
|
+
data-colorpicker="format:hex,presets:true"
|
|
82
|
+
data-preset-colors="#3b82f6,#10b981,#f59e0b,#ef4444"
|
|
83
|
+
value="#3b82f6"
|
|
84
|
+
>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Compact Mode
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<input data-colorpicker="format:hex,compact:true" value="#8b5cf6">
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### With Screen Color Picker
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<input data-colorpicker="format:hex,eyeDropper:true">
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Inline Mode
|
|
100
|
+
|
|
101
|
+
```html
|
|
102
|
+
<input data-colorpicker="format:hex,inline:true">
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Input Preview Mode
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<input data-colorpicker="format:hex,inputPreview:true">
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## ⚙️ Options
|
|
112
|
+
|
|
113
|
+
| Option | Type | Default | Description |
|
|
114
|
+
|--------|------|---------|-------------|
|
|
115
|
+
| `format` | `string` | `'hex'` | Color format: `hex`, `hex8`, `rgb`, `rgba`, `hsl`, `hsla` |
|
|
116
|
+
| `showAlpha` | `boolean` | `false` | Show alpha/transparency slider |
|
|
117
|
+
| `defaultColor` | `string` | `'#3b82f6'` | Initial color if input is empty |
|
|
118
|
+
| `presetColors` | `string[]` | `[]` | Array of preset colors |
|
|
119
|
+
| `presetLabels` | `string[]` | `[]` | Labels for preset colors |
|
|
120
|
+
| `compact` | `boolean` | `false` | Show as compact button instead of input |
|
|
121
|
+
| `inline` | `boolean` | `false` | Always show picker (no popup) |
|
|
122
|
+
| `presetsOnly` | `boolean` | `false` | Show only preset colors |
|
|
123
|
+
| `listView` | `boolean` | `false` | Show presets as list with labels |
|
|
124
|
+
| `sliderMode` | `boolean` | `false` | Use individual sliders for H, S, L instead of 2D picker |
|
|
125
|
+
| `inputPreview` | `boolean` | `false` | Show color preview inside input field |
|
|
126
|
+
| `eyeDropper` | `boolean` | `false` | Enable screen color picker (EyeDropper API + System fallback) |
|
|
127
|
+
| `closeOnSelect` | `boolean` | `true` | Close picker when selecting preset |
|
|
128
|
+
| `onChange` | `function` | `() => {}` | Callback when color changes |
|
|
129
|
+
| `appendTo` | `HTMLElement` | `document.body` | Where to append the picker |
|
|
130
|
+
|
|
131
|
+
## 🎨 Theming
|
|
132
|
+
|
|
133
|
+
Pickit Color uses CSS custom properties for easy theming:
|
|
134
|
+
|
|
135
|
+
```css
|
|
136
|
+
.colorpicker-container {
|
|
137
|
+
--cp-primary: #3b82f6;
|
|
138
|
+
--cp-bg: #ffffff;
|
|
139
|
+
--cp-text: #1f2937;
|
|
140
|
+
--cp-border: #e5e7eb;
|
|
141
|
+
--cp-radius: 8px;
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 🌐 Browser Support
|
|
146
|
+
|
|
147
|
+
- Chrome 95+ (EyeDropper API)
|
|
148
|
+
- Firefox 96+
|
|
149
|
+
- Safari 15.4+ (System ColorPicker with EyeDropper)
|
|
150
|
+
- Edge 95+
|
|
151
|
+
|
|
152
|
+
## 📄 License
|
|
153
|
+
|
|
154
|
+
This software is **Donationware**. You can use it for free, but if you find it useful, please consider supporting development:
|
|
155
|
+
|
|
156
|
+
💖 [Sponsor on GitHub](https://github.com/sponsors/skerbis)
|
|
157
|
+
|
|
158
|
+
## 👨💻 Author
|
|
159
|
+
|
|
160
|
+
**Thomas Skerbis**
|
|
161
|
+
KLXM Crossmedia
|
|
162
|
+
[GitHub](https://github.com/skerbis) • [Website](https://klxm.de)
|
|
163
|
+
|
|
164
|
+
## 🙏 Acknowledgments
|
|
165
|
+
|
|
166
|
+
Built with modern web standards and accessibility in mind. Inspired by the need for a lightweight, feature-rich color picker without dependencies.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
Made with ❤️ by [Thomas Skerbis](https://github.com/skerbis)
|