A simple color convert tool for Node.js
MIT License
A simple color convert tool for Node.js
Currently supports Decimal, Hexadecimal and RGB colors.
npm install @tolga1452/color-converter.js
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 ]
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 ]
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
Please create new issue on GitHub for any feedback or bug reports