
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
a minimal color picker
Just add the script and the colorpicker will work on any input[type=color]. Even if you add them to DOM afterwards.
The implementation is minimal, the code is minimal, even the colorpicker itself is a mere six elements in a wrapper and some smart CSS.
Checkout https://sjeiti.github.io/clr/ for live examples.
To install do npm i -S mc_picker or yarn add mc_picker -S and import it somewhere: import 'mc_picker'.
Or load into HTML directly from CDN with <script src="https://unpkg.com/mc_picker"></script>.
The input[type=color] can have a related dataList. These are shown as swatch options at the top of the color picker. The options are not validated against so the regular interface is still functional.
Although input[type=color] does not support alpha channels, you can add this by setting [data-alpha=255]. The value ranges from 0 to 255 and updates when changed.
The input value itself is still the regular rgb format so you'll have to concat it from the data-attribute yourself, or use the API.
When activated, each input element exposes a color object: document.querySelector('input').color. All instances are also exposed on globalThis.pickers; a map with the HTMLInputElement as key.
You can easily adjust dimensions through CSS without affecting functionality:
.mcpicker {
--mcp-w: 20rem;
--mcp-h: 20rem;
--mcp-gutter: 2rem;
--mcp-font-size: 1.2rem;
}
This can also be done for a single instance when you use .mcpicker_[color input id] instead of .mcpicker.
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
Mc Picker, a minimal color picker
The npm package mc_picker receives a total of 2 weekly downloads. As such, mc_picker popularity was classified as not popular.
We found that mc_picker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.