Skip to content

Instantly share code, notes, and snippets.

@ngnmtl
Forked from abritinthebay/consoleColors.js
Created November 19, 2021 05:14
Show Gist options
  • Save ngnmtl/9bcc93f22281c25fa60fd6c5d0f32ebd to your computer and use it in GitHub Desktop.
Save ngnmtl/9bcc93f22281c25fa60fd6c5d0f32ebd to your computer and use it in GitHub Desktop.

Revisions

  1. Gregory Wild-Smith revised this gist May 12, 2017. 1 changed file with 24 additions and 23 deletions.
    47 changes: 24 additions & 23 deletions consoleColors.js
    Original file line number Diff line number Diff line change
    @@ -5,28 +5,29 @@
    //
    // ... and so on.

    Reset = "\x1b[0m"
    Bright = "\x1b[1m"
    Dim = "\x1b[2m"
    Underscore = "\x1b[4m"
    Blink = "\x1b[5m"
    Reverse = "\x1b[7m"
    Hidden = "\x1b[8m"
    export const reset = "\x1b[0m"
    export const bright = "\x1b[1m"
    export const dim = "\x1b[2m"
    export const underscore = "\x1b[4m"
    export const blink = "\x1b[5m"
    export const reverse = "\x1b[7m"
    export const 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"
    export const black = "\x1b[30m"
    export const red = "\x1b[31m"
    export const green = "\x1b[32m"
    export const yellow = "\x1b[33m"
    export const blue = "\x1b[34m"
    export const magenta = "\x1b[35m"
    export const cyan = "\x1b[36m"
    export const white = "\x1b[37m"

    export const BGblack = "\x1b[40m"
    export const BGred = "\x1b[41m"
    export const BGgreen = "\x1b[42m"
    export const BGyellow = "\x1b[43m"
    export const BGblue = "\x1b[44m"
    export const BGmagenta = "\x1b[45m"
    export const BGcyan = "\x1b[46m"
    export const BGwhite = "\x1b[47m"

    BgBlack = "\x1b[40m"
    BgRed = "\x1b[41m"
    BgGreen = "\x1b[42m"
    BgYellow = "\x1b[43m"
    BgBlue = "\x1b[44m"
    BgMagenta = "\x1b[45m"
    BgCyan = "\x1b[46m"
    BgWhite = "\x1b[47m"
  2. Gregory Wild-Smith created this gist May 12, 2017.
    32 changes: 32 additions & 0 deletions consoleColors.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    // Colors reference
    // You can use the following as so:
    // console.log(colorCode, data);
    // console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`);
    //
    // ... and so on.

    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"