From a003aaa797c8d44e0fcff6677eb7044412844b90 Mon Sep 17 00:00:00 2001 From: Valerie Date: Thu, 13 Apr 2023 15:41:38 -0400 Subject: [PATCH] added colors, list entries, and match arms for three "complex" flags (progress, polyam, intersex) --- Cargo.toml | 2 +- src/draw.rs | 1 - src/flag.rs | 29 +++++++++++++++++++++++++++++ src/main.rs | 13 ++++++++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 691cedd..96c4d5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pride" -version = "0.0.1" +version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/draw.rs b/src/draw.rs index ce7957f..487ccf1 100644 --- a/src/draw.rs +++ b/src/draw.rs @@ -49,4 +49,3 @@ pub fn draw(colors: &[Fg]) { stdout.flush().ok(); } - diff --git a/src/flag.rs b/src/flag.rs index d0c3bd0..2bcf125 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -5,6 +5,21 @@ use crate::draw::draw; pub static BLOCK: &str = "█"; +pub fn progress(small: bool) { + let red = color::Fg(color::Rgb(0xE5, 0x00, 0x00)); + let orange = color::Fg(color::Rgb(0xFF, 0x8D, 0x00)); + let yellow = color::Fg(color::Rgb(0xFF, 0xEE, 0x00)); + let green = color::Fg(color::Rgb(0x02, 0x81, 0x21)); + let blue = color::Fg(color::Rgb(0x00, 0x4C, 0xFF)); + let purple = color::Fg(color::Rgb(0x77, 0x00, 0x88)); + + let white = color::Fg(color::Rgb(0xFF, 0xFF, 0xFF)); + let pink = color::Fg(color::Rgb(0x7A, 0xCB, 0xF5)); + let ltblue = color::Fg(color::Rgb(0xEA, 0xAC, 0xB8)); + let brown = color::Fg(color::Rgb(0x61, 0x39, 0x15)); + let black = color::Fg(color::Rgb(0x00, 0x00, 0x00)); +} + pub fn pride(small: bool) { let red = color::Fg(color::Rgb(0xE5, 0x00, 0x00)); let orange = color::Fg(color::Rgb(0xFF, 0x8D, 0x00)); @@ -127,6 +142,11 @@ pub fn gendervoid(small: bool) { } else { draw(&[navy, gray, black, gray, navy]); } } +pub fn intersex(small: bool) { + let yellow = color::Fg(color::Rgb(0xFF, 0xDA, 0x00)); + let purple = color::Fg(color::Rgb(0x7A, 0x00, 0xAC)); +} + pub fn lesbian(small: bool) { let red = color::Fg(color::Rgb(0xD6, 0x28, 0x00)); let orange = color::Fg(color::Rgb(0xFF, 0x9B, 0x56)); @@ -194,3 +214,12 @@ pub fn pansexual(small: bool) { } else { draw(&[magenta, yellow, cyan]); } } +pub fn polyamorous() { + let blue = color::Fg(color::Rgb(0x01, 0x9F, 0xE3)); + let magenta = color::Fg(color::Rgb(0xE5, 0x00, 0x51)); + let purple = color::Fg(color::Rgb(0x34, 0x0C, 0x46)); + + let white = color::Fg(color::Rgb(0xFF, 0xFF, 0xFF)); + let yellow = color::Fg(color::Rgb(0x00, 0xFC, 0xBF)); +} + diff --git a/src/main.rs b/src/main.rs index 5a52c0d..8df2be8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,8 @@ fn main() { let subcommand = args.subcommand().unwrap(); match subcommand.as_deref() { + Some("progress") => flag::progress(small), + Some("pride") | Some("gay") => flag::pride(small), @@ -45,6 +47,8 @@ fn main() { Some("gendervoid") => flag::gendervoid(small), + Some("intersex") => flag::intersex(small), + Some("lesbian") => flag::lesbian(small), Some("multigender") => flag::multigender(small), @@ -55,6 +59,11 @@ fn main() { Some("pan") | Some("pansexual") => flag::pansexual(small), + Some("poly") | + Some("polyam") | + Some("polyamory") | + Some("polyamorous") => flag::polyamorous(), + _ => { help_text(); exit(1) } } } @@ -87,11 +96,13 @@ fn list_text() { println!(" bi, bisexual bisexual pride flag"); println!(" gay, pride six-color rainbow flag"); println!(" gendervoid gendervoid pride flag"); + println!(" intersex intersex pride flag"); println!(" lesbian lesbian pride flag"); println!(" multigender multigender pride flag"); println!(" nb, nonbinary nonbinary pride flag"); println!(" pan, pansexual pansexual pride flag"); -// println!(" progress progress arrow flag"); + println!(" poly, polyamory polyamorous pride flag"); + println!(" progress progress arrow flag"); println!(" trans, transgender transgender pride flag"); }