1.0.0 • Published 2 years ago
@tolga1452/color-converter.js v1.0.0
color-converter.js
A simple color convert tool for Node.js
Currently supports Decimal, Hexadecimal and RGB colors.
Installation
npm install @tolga1452/color-converter.js
Usage
Converting Decimal Colors
const Color = require('@tolga1452/color-converter.js');
var color = new Color(1357567);
console.log(color.hex); //Output => "#0f7fbf"
console.log(color.rgb); //Output => [ 20, 182, 255 ]
Converting Hexadecimal Colors
const Color = require('@tolga1452/color-converter.js');
var color = new Color("#0f7fbf");
console.log(color.decimal); //Output => 1357567
console.log(color.rgb); //Output => [ 20, 182, 255 ]
Converting RGB Colors
const Color = require('@tolga1452/color-converter.js');
var color = new Color([ 20, 182, 255 ]);
console.log(color.hex); //Output => "#0f7fbf"
console.log(color.decimal); //Output => 1357567
Bug Reports & Feedbacks
Please create new issue on GitHub for any feedback or bug reports
1.0.0
2 years ago