![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
colorconverterjs
Advanced tools
Readme
Easy color conversion between Hex, RGB and CMYK
// to-do
colorconverter.from_rgb({r: 10, g: 20, b:30 }).hex()
// "#0a141e"
colorconverter.from_hex('#0a141e').rgb()
// {r: 10, g: 20, b:30 }
colorconverter.from_hex('#8a796b').cmyk()
// {c: 0, m: 12, y: 22, k: 46 }
colorconverter.from_cmyk({c: 0, m: 12, y: 22, k: 46 }).hex()
// "#8a796b"
Available methods
hex()
- returns a string with a hexadecimal valuerbg()
- returns an object with a RGB valuecmyk()
- returns an object with a CMYK valuecolorconverter.rgb_to_hex({r: 10, g: 20, b:30 })
// "#0a141e"
colorconverter.hex_to_rgb('#0a141e')
// {r: 10, g: 20, b:30 }
colorconverter.hex_to_cmyk('#8a796b')
// {c: 0, m: 12, y: 22, k: 46 }
colorconverter.cmyk_to_hex({c: 0, m: 12, y: 22, k: 46 })
// "#8a796b"
Available conversion methods
rgb_to_hex(object)
- returns a string with a hexadecimal value for the RGB color objecthex_to_rgb(string)
- returns an object with the RGB color values from a Hexadecimal stringcmyk_to_hex(object)
- returns a string with a hexadecimal value for the CMYK color objecthex_to_cmyk(string)
- returns an object with the CMYK color values from a Hexadecimal stringAvailable helper methods
from_hex(string)
- creates an instance of the converter using the hexadecimal value received as the seedfrom_rgb(object)
- creates an instance of the converter using the RGB object received as the seedfrom_cmyk(object)
- creates an instance of the converter using the CMYK object received as the seedconfigure:
$ npm install
test:
$ grunt test
compile:
$ grunt build
FAQs
Color Conversion between Hex, RGB and CMYK
The npm package colorconverterjs receives a total of 0 weekly downloads. As such, colorconverterjs popularity was classified as not popular.
We found that colorconverterjs demonstrated a not healthy version release cadence and project activity because the last version was released 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.