Skip to content

Doesn't recognize RGB colors supported by newer versions of chalk. #10

@danfuzz

Description

@danfuzz
  • Example code:
const chalk = require('chalk');
const ansiHtml = require('ansi-html');
const inspect = require('util').inspect;

chalk.enabled = true;
chalk.level = 3;
const c = chalk.hex('#405060')('Hello');
const h = ansiHtml(c);

console.log(inspect(c));
console.log(inspect(h));
  • Expected output:

Something like this:

'\\u001b[38;2;64;80;96mHello\\u001b[39m'
'<span style="color:#405060;">Hello</span>'
  • Actual output
'\\u001b[38;2;64;80;96mHello\\u001b[39m'
'\\u001b[38;2;64;80;96mHello</span>'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions