-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blackBright is mentioned in README but is not implemented #33
Comments
Black bright is actually it's own color believe it or not. On Windows there are four greyscale shades. I'll take a look :) |
Had no idea. Please, by all means, take a look. Side note: I spent last night trying to get black on yellow to show up nicely on Windows... I wish I could have that time back. |
What did you try? Are you using chalk or consuming |
I was using chalk. Even with Then I made it blue on yellow, and it was legible with both default colours and base16-tomorrow. Go figure! |
@vsimonian So even with As for the colors in the terminal, if black ( Which terminal are you using? |
Yes, Windows 10. I was just trying everything out of desperation. Probably went through every combination of black or black-ish you could think of. Still possible I missed something; I was pretty frustrated! It works now and I'm afraid to touch it. |
Is this cmd.exe or some other terminal that you're using? (I know the ticket is closed but I'm still interested in figuring out why it didn't show up as black for you :)) Also thanks for the report. |
Also, you might want to commit the same fix you made here on |
That's actually super weird. |
Just tested:
Which is bright yellow (ansi-styles will add 10 to get the background code in this case). So maybe those terminals don't support bright codes? Very strange. Just curious; what does the following show up as: chalk.yellowBright.bgBlack.inverse(' WARNING ') |
What build of Windows 10 are you on? Conhost doesn't surprise me at all. Don't use it if you want terminal colors IMO. Anyway, you're right in that cmd.exe should be working. EDIT: Also, thank you for taking the time to do all of these. It's really appreciated. |
Version 1703, build 15063 And I agree ConHost is And don't go thanking me for spamming this issue with pictures - at this point I might as well just be venting. Thanks for looking into the darn thing! What's interesting to me is that this So here's what I put together: const chalk = require('chalk')
const boldTags = {
/** [ERROR] */
error: chalk.supportsColor
? chalk.bgRed.whiteBright.bold(' ERROR ')
: '[ERROR]',
/** [WARNING] */
warning: chalk.supportsColor
? (chalk.level > 1
? chalk.bgYellow.bgKeyword('orange').black.bold
: chalk.bgYellow.black.bold)(' WARNING ')
: '[WARNING]',
/** [INFO] */
info: chalk.supportsColor
? chalk.bgBlue.whiteBright.bold(' INFO ')
: '[INFO]'
}
const inverseTags = {
/** [ERROR] */
error: chalk.supportsColor
? chalk.bgWhiteBright.red.inverse.bold(' ERROR ')
: '[ERROR]',
/** [WARNING] */
warning: chalk.supportsColor
? (chalk.level > 1
? chalk.yellow.keyword('orange').bgBlack.inverse.bold
: chalk.yellow.bgBlack.inverse.bold)(' WARNING ')
: '[WARNING]',
/** [INFO] */
info: chalk.supportsColor
? chalk.blue.bgWhiteBright.inverse.bold(' INFO ')
: '[INFO]'
}
console.log(`Regular tags:
${boldTags.error}
${boldTags.warning}
${boldTags.info}`)
console.log(`Inverse tags:
${inverseTags.error}
${inverseTags.warning}
${inverseTags.info}`) And here are the results: Using It seems you know something I don't regarding the functionality of |
Inverse is its own code, It's pretty cross platform compatible in that all terminals on non-windows support it and it has first class support in LibUV (I know because I wrote that support myself 🙂) which means it is supported on windows terminals that respond to the |
I haven't had a chance to have a crack at testing this on my Fedora installation or on my MacBook, but if I get you correctly, you're saying using this archaic code fooled Windows into doing the right thing, but on *nix OSes I would have been most likely getting the correct colour output with just |
Correct. |
…go>add note about brightBlack (ref chalk/ansi-styles#33)</cargo>
…go>add note about brightBlack (ref chalk/ansi-styles#33)</cargo>
blackBright
is mentioned as a supported foreground colour inREADME.md
but is not actually implemented inindex.js
.Because
blackBright
is really just grey, it's not immediately clear if the fix is to remove it from the readme or to alias it to/use the value fromgray
.It's also worth noting the same is the case for the chalk repository.
The text was updated successfully, but these errors were encountered: