Skip to content

A simple color picker for the web implemented in javascript

License

Notifications You must be signed in to change notification settings

neknaj/colorpicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Color Picker

A simple color picker for the web implemented in javascript

Usage

Init

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

<script src="colorpicker.js"></script>
<canvas id="colorpicker"></canvas>
<script>
    ColorPicker(document.querySelector("#colorpicker"),40,10);

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

About

A simple color picker for the web implemented in javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published