From a808e7996ba201f02c2ae078677a7ab806563d75 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Mon, 29 Apr 2024 22:54:52 +0200 Subject: [PATCH] pink sand! --- Cargo.lock | 7 +++++++ petri/src/lib.rs | 9 ++++----- uscope/Cargo.toml | 1 + uscope/src/main.rs | 3 ++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf36c49..ac9ece5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2617,6 +2617,12 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "owo-colors" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" + [[package]] name = "parking" version = "2.2.0" @@ -3340,6 +3346,7 @@ name = "uscope" version = "0.1.0" dependencies = [ "bevy", + "owo-colors", "petri", ] diff --git a/petri/src/lib.rs b/petri/src/lib.rs index 478f486..11d29c6 100644 --- a/petri/src/lib.rs +++ b/petri/src/lib.rs @@ -81,7 +81,7 @@ impl Dish { height: 2, contents: vec![ Some(Cell::WHITE), - Some(Cell::EMPTY), + None, Some(Cell::WHITE), Some(Cell::EMPTY), ], @@ -91,7 +91,7 @@ impl Dish { height: 2, contents: vec![ Some(Cell::EMPTY), - Some(Cell::EMPTY), + None, Some(Cell::WHITE), Some(Cell::WHITE), ], @@ -102,7 +102,7 @@ impl Dish { width: 2, height: 2, contents: vec![ - Some(Cell::EMPTY), + None, Some(Cell::WHITE), Some(Cell::EMPTY), Some(Cell::WHITE), @@ -112,7 +112,7 @@ impl Dish { width: 2, height: 2, contents: vec![ - Some(Cell::EMPTY), + None, Some(Cell::EMPTY), Some(Cell::WHITE), Some(Cell::WHITE), @@ -195,7 +195,6 @@ impl RulePattern { if x >= self.width || y >= self.height { None } else { - // dbg!(x, y); self.contents[x + self.width * y].clone() } } diff --git a/uscope/Cargo.toml b/uscope/Cargo.toml index 08e153e..458da74 100644 --- a/uscope/Cargo.toml +++ b/uscope/Cargo.toml @@ -8,3 +8,4 @@ edition = "2021" [dependencies] petri = { path = "../petri" } bevy = { version = "0.13", features = ["dynamic_linking"] } +owo-colors = "4.0.0" diff --git a/uscope/src/main.rs b/uscope/src/main.rs index cd8bee1..6fae2a5 100644 --- a/uscope/src/main.rs +++ b/uscope/src/main.rs @@ -1,3 +1,4 @@ +use owo_colors::OwoColorize; use petri::{Cell, Dish, CHUNK_SIZE}; fn main() { @@ -30,7 +31,7 @@ fn render_pixel_pair(dish: &Dish, x: usize, y: usize) { (true, false) => "▀", (true, true) => "█", }; - print!("{}", char); + print!("{}", char.fg_rgb::<255, 147, 219>()); } pub fn wait_for_input() {