Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```html

ColorPicker(document.querySelector("#colorpicker"),40,10);

document.querySelector("#colorpicker").addEventListener("changeColor",(e)=>{
console.log("color changed",e.detail);
})

```