Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neknaj/colorpicker
A simple color picker for the web implemented in javascript
https://github.com/neknaj/colorpicker
Last synced: 13 days ago
JSON representation
A simple color picker for the web implemented in javascript
- Host: GitHub
- URL: https://github.com/neknaj/colorpicker
- Owner: neknaj
- License: mit
- Created: 2024-03-10T16:42:22.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-10T22:31:45.000Z (11 months ago)
- Last Synced: 2024-03-11T18:27:39.876Z (11 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Color Picker
A simple color picker for the web implemented in javascript## Usage
### Init
```js
function ColorPicker(colorpicker,handleSize,margin)
```
`colorpicker`: html canvas element for color picker (HTMLCanvasElement)
`handleSize`: Handle size (Number)
`margin`: Margin size within the UI (Number)
### Events
`changeColor`: when the color is changed## Sample Code
```htmlColorPicker(document.querySelector("#colorpicker"),40,10);
document.querySelector("#colorpicker").addEventListener("changeColor",(e)=>{
console.log("color changed",e.detail);
})```