Conversation
cba9042 to
4d0ebeb
Compare
|
Hi @djc, Can I get some feedback on this? |
|
It's on my list but it's not very high priority right now (unless your org can fund the work). |
4d0ebeb to
f39ffe8
Compare
|
Ok, no rush. When you get a chance please kick off workflows so I can make sure tests are passing. |
|
Changed the settings to allow workflows to run without my approval. |
852a47d to
9d7ed15
Compare
Signed-off-by: Joe Grund <grundjoseph@gmail.com>
| } | ||
|
|
||
| /// Parses a hex color string like "#ff0000" into a (r, g, b) tuple. | ||
| fn parse_hex_color(s: &str) -> Option<(u8, u8, u8)> { |
There was a problem hiding this comment.
Nit: I'd like a separate prefix commit (or PR) that extracts this.
| } | ||
|
|
||
| #[inline] | ||
| const fn get_fg_gradient(&self) -> Option<FgGradient> { |
There was a problem hiding this comment.
Nit: prefer to avoid get_() prefixes per the API guidelines.
| self.fg(Color::Black) | ||
| } | ||
| #[inline] | ||
| pub const fn black_end(self) -> Self { |
There was a problem hiding this comment.
I think I'd prefer not to have separate methods for each color _end().
|
|
||
| #[inline] | ||
| const fn get_fg_gradient(&self) -> Option<FgGradient> { | ||
| let Some(start) = self.fg else { |
There was a problem hiding this comment.
Nit: suggest spelling this as
match (self.fg, self.fg_end) {
(Some(start), Some(end)) => Some(FgGradient { start, end }),
_ => None,
}| impl_fmt!(UpperExp); | ||
| impl_fmt!(UpperHex); | ||
|
|
||
| struct Gradient { |
There was a problem hiding this comment.
Suggest adding a little more structure here, along the lines of:
struct Gradients {
fg: Gradient,
bg: Gradient,
}
impl Gradients {
// attach `fmt_gradient()` here, or turn it into a `Display` impl for `Gradients`?
}
This PR adds support for fg / bg gradients. It tries to utilize existing structure and expand on it.
Screenshot from example: