Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-tin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Color-tin
Generate darker and lighter color shades at every 5% step from -100% to +100%.
Supports HEX (#3498db) and RGB (rgb(52,152,219)) formats.
📦 Installation
npm install color-tin🚀 Usage
// ES6 (ESM)
import { colorBox } from "color-tin";
// ES5 (CommonJS)
const { colorBox } = require("color-tin");
console.log(colorBox("rgb(52,152,219)"));Example Output
{
"original": "#3498db",
"darker_5": "#308dc9",
"darker_10": "#2c82b7",
...
"lighter_95": "#f6fbfe",
"lighter_100": "#ffffff"
}Color brightness
The function brightness() exported by the library returns the brightnes of the a color passed in percentage
// ES6 (ESM)
import { brightness } from "color-tin";
// ES5 (CommonJS)
const { brightness } = require("color-tin");
console.log(brightness("rgb(52,152,219)"));🛠 Features
- Generate shades every 5% (-100% to +100%)
- Supports HEX and RGB input
- Returns all shades as an object
- Determine brightness of a color in percentage
- Works in Node.js, React, and Vanilla JS