question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use with "colors" lib?

See original GitHub issue

https://github.com/Marak/colors.js https://www.npmjs.com/package/colors https://www.npmjs.com/package/chalk

Is there anything preventing this from working with the lib mentioned above? It should just be dealing with the escape sequences correct?

I’m having an issue getting it to work, which is not to say it’s an issue with xterm.js just that I am not aware of how to make it work or is an alternate color lib would be better suited.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

13reactions
theladyjayecommented, Aug 17, 2017

@Tyriar ok I figured it out…

Chalk is doing some auto detection to see what it should support, using this lib: https://github.com/chalk/supports-color

Long story short, chalk thinks nothing is supported color wise, so it doesn’t process the strings.

let options: any = {enabled: true, level: 2};
const forcedChalk = new chalk.constructor(options);

^ fixes it in the browser

where Levels are:

0: All colors disabled
1: Basic color support (16 colors)
2: 256 color support
3: Truecolor support (16 million colors)
5reactions
mbnatafgicommented, Apr 11, 2020

@aventurella thank you! but it seems that chalk.constructor is deprecated and may have been removed in the latest versions. We ought to use chalk.Instance instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use - Color Library
1. In the Layers panel, click the Channels tab and double-click on the channel for which you want to change the color. ·...
Read more >
How to Use Color Libraries in Photoshop - SkillForge
From the picker, you can click the Color Libraries button on the right. Then call up the appropriate book at the top, then...
Read more >
7 JavaScript Color Libraries and Which Should You Choose
If you're looking for a library that can give you more methods to manipulate and interpolate colors, then you should check out chroma.js....
Read more >
W3.CSS Color Libraries - W3Schools
Color libraries are small CSS files containing commonly used color values like safety standards, highway colors, fashion colors, camouflage colors, and more ...
Read more >
Access Creative Cloud libraries in Fresco - Adobe Support
All your color themes and swatches in Creative Cloud libraries are available to you in the Color panel of Adobe Fresco. Tap on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found