
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@baianat/colorpicker
Advanced tools
ES6 color picker extension for Base framework.
You can install colorpicker as part of base.extensions.
npm install @baianat/base.extensions
# or using yarn
yarn add @baianat/base.extensions
If you want the standalone version.
npm install @baianat/colorpicker
yarn add @baianat/colorpicker
<head>
<link rel="stylesheet" href="dist/css/colorpikcer.css">
</head>
<body>
...
<script type="text/javascript" src="dist/js/colorpikcer.js"></script>
</body>
You need an input element to track the color value.
<input id="myPicker">
<script>
const picker = new Colorpicker('#myPicker', {
// default starter color
defaultColor = '#ffffff',
// color wheel radius in px
radius = 200,
// output color mode 'rgb', 'hex' or 'hsl'
mode = 'rgb',
// array of colors to fill recent colors, max of 6 colors
recentColors = ['#c1c1c1', '#000000', '#ffffff'],
// events to fire
events = {
// fires before selecting a color
beforeSelect() {},
// fires after selecting a color
afterSelect() {},
// fires before opening color picker menu
beforeOpen() {},
// fires after opening color picker menu
afterOpen() {},
// fires before clicking submit button
beforeSubmit() {},
// fires after clicking submit button
afterSubmit() {},
// fires on clicking on any part of the picker menu
clicked() {}
}
});
// to track color changes
picker.el.addEventListener('change', () => {
// do something great!
})
</script>
You can call method on Colorpicker instance
const newPicker = new Picker('#myPicker');
newPicker.selectColor('#ff00ff');
| Method | Argument | Description |
|---|---|---|
selectColor | [String] color, [Bool] mute | you can change the selected with color argument. If you want to stop the picker from dispatching events, you can set mute to true. It's false by default. |
getColorFromSliders | It returns the rgb sliders values as string e.g. "rgb(71, 182, 148)" | |
getColorFromWheel | [Object] mouse | It accepts an object, holds the x and y location on the wheel {x: 100, y: 100}, then returns its rgb value |
togglePicker | show/hide picker menu | |
closePicker | hide picker menu | |
openPicker | show picker menu |
Copyright (c) 2017 Baianat
FAQs
ES6 colorpicker
We found that @baianat/colorpicker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.