color-god
v1.0.4
Published
A package for different functions related to colors, .
Downloads
14
Maintainers
Readme
color-god
A package for color codes, color generation, color manupulation.
Installation
You can install color-god
via npm:
npm install color-god
Usage
const generatePalette = require('color-god');
// Example usage
const baseColor = '#3498db'; // Base color in hex format
const numColors = 5; // Number of colors in the palette
const colorPalette = generatePalette(baseColor, numColors);
console.log('Generated Color Palette:', colorPalette);
hexToRgb
The hexToRgb
function converts a color from hexadecimal format to RGB format.
const hexToRgb = require('color-god');
// Example usage
const hexColor = '#3498db'; // Color in hex format
const rgbColor = hexToRgb(hexColor);
This will output:
RGB Color: rgb(52, 152, 219)
colorCode
The colorCode
object contains color names mapped to their RGB values.
const { colorCode } = require('color-god');
// Example usage
const colorName = 'red'; // Color name
const rgbColor = colorCode[colorName];
This will output:
```bash
RGB Color code: [255, 0, 0]
## License
This package is open source and available under the [MIT License](https://opensource.org/licenses/MIT).