From 833c42b9baf7275c794a9caedaa993c4b3b27ba7 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Wed, 8 Mar 2023 09:47:07 -0500 Subject: [PATCH] [+] Rust constants --- tngame-rs/src/main.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tngame-rs/src/main.rs diff --git a/tngame-rs/src/main.rs b/tngame-rs/src/main.rs new file mode 100644 index 0000000..4bdaef0 --- /dev/null +++ b/tngame-rs/src/main.rs @@ -0,0 +1,30 @@ +#![feature(let_chains)] + +use std::io::{stdin, Write}; +use std::{io, mem, thread}; +use std::borrow::ToOwned; +use std::ptr::null; +use std::string::ToString; +use std::time::{Duration, Instant}; +use rand::Rng; +use anyhow::Result; +use termion::color::{Fg, Rgb}; +use termion::cursor::Goto; + +const RESET: &str = "\x1b[0m"; + +/// Constants +const SNOW_DENSITY: f32 = 0.05; // Snow particles per pixel on screen +const SNOW_SPEED: f32 = 8.0; // Snow fall speed in pixels per second +const SNOW_X_RAND: f32 = 0.8; // Snow x velocity randomization factor + +/// Colors: Convert them in python using hyfetch - print(repr(RGB.from_hex('#FFFFFF'))) +const COLORS_STR: [&str; 3] = [ + // # FFFFFF + "\x1b[38;2;246;170;183m", + // # F6AAB7 + "\x1b[38;2;255;255;255m", + // # 55CDFD + "\x1b[38;2;85;205;253m" +]; +