diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2021-11-16 19:12:36 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2021-11-16 19:14:36 +0100 |
commit | 689b732184c227b4f49e2b509fad06c1f31c4e4b (patch) | |
tree | 9fc5657e20f761333b3df071076175477d76af2e /src/vtcol.rs | |
parent | e1755da9f1c2755f72cbf843dd653c3f6f71c7e8 (diff) | |
download | vtcol-689b732184c227b4f49e2b509fad06c1f31c4e4b.tar.gz |
switch RawPalette to integer representation
Introducing a simple type for RGB colors. That awkward string
representation for RawPalette got unwieldy quick.
Diffstat (limited to 'src/vtcol.rs')
-rw-r--r-- | src/vtcol.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vtcol.rs b/src/vtcol.rs index d3399fc..b0c4b85 100644 --- a/src/vtcol.rs +++ b/src/vtcol.rs @@ -187,11 +187,11 @@ impl<'a> Job ) }), Scheme::Custom(None) => - Palette::from_stdin().dump(&mut out).map_err(|e| { + Palette::from_stdin()?.dump(&mut out).map_err(|e| { anyhow!("error loading palette from stdin: {}", e) }), Scheme::Custom(Some(fname)) => - Palette::from_file(&fname).dump(&mut out).map_err(|e| { + Palette::from_file(&fname)?.dump(&mut out).map_err(|e| { anyhow!( "error loading palette from file [{}]: {}", fname.display(), @@ -251,7 +251,7 @@ impl<'a> Job let fd = Console::current()?; vrb!("console fd: {}", fd); - if fd.current_palette()? == Palette::from(&one) { + if fd.current_palette()? == Palette::try_from(&one)? { Self::set_scheme(two) } else { Self::set_scheme(one) |