-
Notifications
You must be signed in to change notification settings - Fork 283
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
Allow for optional colors #611
Conversation
Is this really a good idea to alter the logo's original colour palette? IMO, this may help a small portion of users on light theme terminals in terms of readability but they will lose in terms of aesthetics. |
Well the main reason was to allow the logo's "white" color to just be the text color. I agree that this is a massive change, but we've gotten a few notes that onefetch doesn't look good on light terminals, and one user pointed out that
(Source: #33 (comment)) It appears that Neofetch doesn't really use the white color. When the default color is white, or the selected color with I think we have 2 options:
|
CI is failing from clippy test unrelated to this PR |
Replaces references to `colored::Color` with `Option<colored::Color>`. Related to #33
Should improve support for light terminal themes by letting the theme pick the default text color. Note that white is not always mapped to a dark color on light themes. `Token` tests adjusted to not assume white color is the default. Addresses #33
Or I suppose we could just make the |
pub enum OptionalColor { | ||
$( $color, )* | ||
TrueColor{ r: u8, g: u8, b: u8 }, | ||
Fg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about mapping White
to None
? Like that we don't need to touch the language definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would work (and be more similar to neofetch). Perhaps White
and Fg
can be effective aliases of each other?
macro_rules! define_optional_color { | ||
($( $color:ident ),*) => { | ||
#[derive(Debug)] | ||
pub enum OptionalColor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sur about the name, what about AsciiColor
instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was back when there was a None
variant. AsciiColor
sounds good to me.
You're right, I guess I was just reluctant to add more complexity to the code that would only be beneficial to a small fraction of users. But, what you did is actually pretty clean and as you pointed out neofetch does exactly that. |
That makes sense. I wouldn't be opposed to delaying any decision on this PR until we get a good idea of how many users really need this (I'm of the opinion that a good light theme would reverse black and white TBH, but it looks like some popular ones don't do that). By making owo-colors also looks like it has an interesting way to colorize that could probably greatly reduce complexity, as opposed to needing to rely on |
This is exactly what we need. It will reduce code clutter by removing the need of using |
Sounds good! I'll leave this PR open for now until the switch to owo-colors is merged. It's unlikely we'll reference commits from this specific PR, but better safe than sorry 🙂 |
This was originally going to be a quick and painless change using an
OptionalColor
type and.into()
, but it quickly turned into way more changes than expected 😅 Hopefully nothing has broken.The last commit is
TEMP
because it seems likestrum
is naively usingNone
instead ofOption::None
in its macro definition, breaking that commit. spenserblack@5142c5f is OK to review, though. I'll make a PR tostrum
, but, assuming spenserblack@5142c5f is good,it's ready to be merged if we don't want to wait.Edit: Nevermind, tests fail on that commit.
Edit2: Force-pushed, 0ef1c64 should be OK.
Edit3: Peternator7/strum#214 merged, on next release this whole PR should be ready to review.
Edit4: No need for a new strum release. I realized that
Fg
is a more descriptive variant thanNone
.