diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-12-27 19:23:26 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-12-27 19:23:26 +0100 |
| commit | 750d220bb080be077cd7ede6d18d485b1c3fb0c9 (patch) | |
| tree | 741bcbf9e286de6433a0677d4bcf8b93d70fb806 /src/parse | |
| parent | c44ebf876f6ab09fe1629d980efc5c4878a6a5a5 (diff) | |
Add color enum 🎨
Diffstat (limited to 'src/parse')
| -rw-r--r-- | src/parse/mod.rs | 4 | ||||
| -rw-r--r-- | src/parse/tests.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 261bbabb..04a9de58 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -487,9 +487,9 @@ fn ident(p: &mut Parser) -> Option<Ident> { /// Parse a color. fn color(p: &mut Parser, hex: &str, start: Pos) -> RgbaColor { RgbaColor::from_str(hex).unwrap_or_else(|_| { - // Heal color by assuming black. + // Replace color with black. p.diag(error!(start .. p.pos(), "invalid color")); - RgbaColor::with_healed(0, 0, 0, 255, true) + RgbaColor::new(0, 0, 0, 255) }) } diff --git a/src/parse/tests.rs b/src/parse/tests.rs index 6d5eee38..1b6df74b 100644 --- a/src/parse/tests.rs +++ b/src/parse/tests.rs @@ -436,7 +436,7 @@ fn test_parse_values() { e!("[val: [hi]]" => ); // Healed colors. - v!("#12345" => Color(RgbaColor::with_healed(0, 0, 0, 0xff, true))); + v!("#12345" => Color(RgbaColor::new(0, 0, 0, 0xff))); e!("[val: #12345]" => s(6, 12, "invalid color")); e!("[val: #a5]" => s(6, 9, "invalid color")); e!("[val: #14b2ah]" => s(6, 13, "invalid color")); |
