This package has been deprecated

Author message:

This package has deprecated. Use @tolga1452/toolbox.js instead.

@tolga1452/color-converter.js

1.0.0 • Public • Published

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

/@tolga1452/color-converter.js/

    Package Sidebar

    Install

    npm i @tolga1452/color-converter.js

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    6.63 kB

    Total Files

    6

    Last publish

    Collaborators

    • tolga1452