Skip to content
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

fix: better output colors #7377

Merged
merged 1 commit into from
Apr 16, 2024
Merged

fix: better output colors #7377

merged 1 commit into from
Apr 16, 2024

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Apr 15, 2024

No more grey, no more setting background color.

Added the beginnings of guidance to the display layer comments.

@wraithgar wraithgar requested a review from a team as a code owner April 15, 2024 21:55
@wraithgar wraithgar changed the title gar/colors fix: better output colors Apr 15, 2024
lib/commands/audit.js Outdated Show resolved Hide resolved
lib/commands/audit.js Outdated Show resolved Hide resolved
lib/commands/fund.js Outdated Show resolved Hide resolved
lib/commands/view.js Outdated Show resolved Hide resolved
lib/utils/display.js Outdated Show resolved Hide resolved
No more grey, no more setting background colors
@wraithgar
Copy link
Member Author

@lukekarrys rebased and fixed merge conflicts in the view command.

@wraithgar wraithgar merged commit 9216d59 into latest Apr 16, 2024
17 of 20 checks passed
@wraithgar wraithgar deleted the gar/colors branch April 16, 2024 17:29
@github-actions github-actions bot mentioned this pull request Apr 16, 2024
Comment on lines +6 to +18
// This is the general approach to color:
// Eventually this will be exposed somewhere we can refer to these by name.
// Foreground colors only. Never set the background color.
/*
* Black # (Don't use)
* Red # Danger
* Green # Success
* Yellow # Warning
* Blue # Accent
* Magenta # Done
* Cyan # Emphasis
* White # (Don't use)
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wraithgar : could you elaborate on why black and white are not explicitly used?

I assume it's because we'll defer to the terminal's default coloring which should hopefully allow users to colorize as desired.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume it's because we'll defer to the terminal's default coloring which should hopefully allow users to colorize as desired.

It's exactly that.

Typically a terminal will configure a separate foreground and background color, discrete from the customizable 16 color palette. From what I've seen they will not also adjust black and white in the palette to be in accordance w/ the foreground/background colors.

If one wants to display with the foreground color, then print with "no" coloring. There is also bold and dim if you need those. In cases where you really do want the background color, you can inverse (I'd probably still avoid that though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants