UNPKG

npm-colors-utils

Version:

Simple color utils for working with colors!

45 lines (32 loc) 1.43 kB
# Colors package - Simple console color package! ```js const colors = require("npm-color-utils"); colors.send("&cRED &bBLACK &aGREEN &mMagenta &xCyan &fWhite &rReset"); //you can use this! console.log(colors.color("&cRED &bBLACK &aGREEN &mMagenta &xCyan &fWhite &rReset &aGREEN")) //.getHEX(red, green, blue) or .getHEX(red, green, blue, alpha) returns hex console.log(colors.getHex(235, 64, 52)); //.getRGB("rgb", true) returns {r: red, g: green, b: blue} .getRGB("rgb", false) returns r: red, g: green, b: blue //false can be used for basic returns and true is for the json; console.log(colors.getRGB("#eb4034", false)) // ---------------------------------------------- // this is const c = new colors.c("text")."function"; // You can also use that! console.log(new colors.c("&cRED &bBLACK &aGREEN &mMagenta &xCyan &fWhite &rReset").getText()) //.getHEX(red, green, blue) or .getHEX(red, green, blue, alpha) console.log(new colors.c().getHEX(235, 64, 52)); //.getRGB("rgb", true) returns {r: red, g: green, b: blue} .getRGB("rgb", false) returns r: red, g: green, b: blue //false can be used for basic returns and true is for the json; console.log(new colors.c(false).getRGB("#eb4034")) // ---- Colors //&c - RED //&b - BLACK //&a - GREEEN //&m - Magenta //&x - Cyan //&f - White //&r - Reset color ``` - You can test it! - Github: https://github.com/Morvicek/color-utils