Skip to content

Tolga1452/color-converter.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple color convert tool for Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published