From 677c1015058573c71d96f54192321d3d2037d168 Mon Sep 17 00:00:00 2001 From: Alex Bethel Date: Thu, 3 Mar 2022 11:58:04 -0700 Subject: [PATCH] Fix color constants No idea how I replaced yellow with brown, but somehow I messed that up. Whatever, I wrote that code a month and a half ago lol --- src/io.rs | 16 ++++++++-------- src/level.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/io.rs b/src/io.rs index 4562ee1..dbc0d3e 100644 --- a/src/io.rs +++ b/src/io.rs @@ -44,14 +44,14 @@ pub fn quit() -> ! { /// The colors on a terminal. #[allow(unused)] pub enum Color { - Black = 0, - Red = 1, - Green = 2, - Brown = 3, - Blue = 4, - Magenta = 5, - Cyan = 6, - White = 7, + Black = pancurses::COLOR_BLACK as _, + Red = pancurses::COLOR_RED as _, + Green = pancurses::COLOR_GREEN as _, + Yellow = pancurses::COLOR_YELLOW as _, + Blue = pancurses::COLOR_BLUE as _, + Magenta = pancurses::COLOR_MAGENTA as _, + Cyan = pancurses::COLOR_CYAN as _, + White = pancurses::COLOR_WHITE as _, } #[derive(Error, Debug)] diff --git a/src/level.rs b/src/level.rs index e0ff253..1082765 100644 --- a/src/level.rs +++ b/src/level.rs @@ -106,7 +106,7 @@ impl DungeonLevel { win.mv(y as _, 0); for x in 0..LEVEL_SIZE.0 { if (x + y) % 2 == 0 { - set_color(win, Color::Cyan); + set_color(win, Color::Yellow); } else { set_color(win, Color::Red); }