Skip to content

Commit 4059323

Browse files
committed
Fix bug where tinty info doesn't list with scheme hex with hash prefix
1 parent 53af1c5 commit 4059323

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
and only printing to stdout or saving to the tinty data directory with
99
the `--save` flag
1010

11+
### Fixed
12+
13+
- Fix bug where `tinty info` doesn't list schemes correctly when the
14+
`palette` hex values contain a `#` prefix
15+
1116
## [0.22.0] - 2024-10-09
1217

1318
### Added

src/operations/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fn print_scheme(scheme_path: &Path) -> Result<()> {
168168

169169
let reset = "\x1B[0m";
170170
for color in palette {
171-
let hex_text = format!("#{}", color);
171+
let hex_text = format!("#{}", color.strip_prefix('#').unwrap_or(&color));
172172
let hex = HexColor::parse(&hex_text)?;
173173
let bg_ansi = format!("\x1B[48;2;{};{};{}m", hex.r, hex.g, hex.b);
174174
let fg_ansi = format!("\x1B[38;2;{};{};{}m", hex.r, hex.g, hex.b);

0 commit comments

Comments
 (0)