From 750d220bb080be077cd7ede6d18d485b1c3fb0c9 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 27 Dec 2020 19:23:26 +0100 Subject: =?UTF-8?q?Add=20color=20enum=20=F0=9F=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parse/mod.rs | 4 ++-- src/parse/tests.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/parse') 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 { /// 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")); -- cgit v1.2.3