@j-dotjs/color-code-converter
v0.0.8
Published
Converts to the specified color code between different color codes
Downloads
3
Readme
color-code-converter
Converts to the specified color code between different color codes
Table of Contents
Installation
npm i @j-dotjs/color-code-converter OR npm install @j-dotjs/[email protected]
Initialization
const colorConverter = require('@j-dotjs/color-code-converter');
Usage
Get Hex Code from Color Name
colorConverter.getHexStr('red'); // #ff0000
colorConverter.getHexStr('blue'); // #0000ff
colorConverter.getHexStr('green'); // #00ff00
etc...
Get Hex Code from RGB
colorConverter.getHexRGB(255, 0, 0); // #ff0000
colorConverter.getHexRGB(0, 0, 255); // #0000ff
colorConverter.getHexRGB(0, 255, 0); // #00ff00
etc...
Planned Features
- [ ] Generate rgb from string
- [x] Generate hex from rgb
- [ ] Generate rgb from hex
License
Author
Disclaimer
Some colors may not be supported. You can suggest colors to be added by creating an issue or forking the repository and creating a pull request. This package is still in development and may not work as intended. Please report any bugs or issues to the issues page.