Answers for "change color console.log"

17

js console log with color

console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
Posted by: Guest on April-09-2020
1

console.log color terminal

Reset = "\x1b[0m"
Bright = "\x1b[1m"
Dim = "\x1b[2m"
Underscore = "\x1b[4m"
Blink = "\x1b[5m"
Reverse = "\x1b[7m"
Hidden = "\x1b[8m"

FgBlack = "\x1b[30m"
FgRed = "\x1b[31m"
FgGreen = "\x1b[32m"
FgYellow = "\x1b[33m"
FgBlue = "\x1b[34m"
FgMagenta = "\x1b[35m"
FgCyan = "\x1b[36m"
FgWhite = "\x1b[37m"

BgBlack = "\x1b[40m"
BgRed = "\x1b[41m"
BgGreen = "\x1b[42m"
BgYellow = "\x1b[43m"
BgBlue = "\x1b[44m"
BgMagenta = "\x1b[45m"
BgCyan = "\x1b[46m"
BgWhite = "\x1b[47m"
Posted by: Guest on October-21-2020
0

how to change the color of a console.log in javascript

// Download the npm package "colors"
// npm i colors

var colors = require("colors");

console.log("Hello World".blue);

// output: Hello World (Its blue btw lmao)
Posted by: Guest on August-02-2021
1

console.log with color font

var colors = require('colors');

console.log('i am black'.bgBlack);
console.log('i am red'.bgRed);
console.log('i am green'.bgGreen);
console.log('i am black'.bgYellow);
console.log('i am blue'.bgBlue);
console.log('i am magenta'.bgMagenta);
console.log('i am cyan'.bgCyan);
console.log('i am white'.bgWhite);
Posted by: Guest on December-10-2020
1

console.log with color font

var colors = require('colors');

console.log('This is bold'.bold);
console.log('This is dim'.dim);
console.log('This is italic'.italic);
console.log('This is underline'.underline);
console.log('This is inverse'.inverse);
console.log('This is hidden'.hidden);
Posted by: Guest on December-10-2020
0

console.log with color font

var colors = require('colors');

console.log('This is rainbow'.rainbow);
console.log('This is zebra'.zebra);
console.log('This is america'.america);
console.log('This is trap'.trap);
console.log('This is random'.random);
console.log('This is random2'.random);
console.log('This is random3'.random);
Posted by: Guest on December-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language