Compare commits
No commits in common. "f7afc30f2eafc6e1cc5825a5c5409183e17015e6" and "f8e02e06fb8a5c059ea2eccd0fad9a6c2c3146d5" have entirely different histories.
f7afc30f2e
...
f8e02e06fb
5 changed files with 18 additions and 102 deletions
11
README.md
11
README.md
|
@ -9,13 +9,6 @@ to make major changes and refactors until the main roadmap is complete.**
|
||||||
|
|
||||||
Currently supports a variety of stripe flags.
|
Currently supports a variety of stripe flags.
|
||||||
|
|
||||||
## Dependencies
|
Under Construction features:
|
||||||
|
- ["Complex" Flags](https://git.vwolfe.io/valerie/pride/src/branch/complex)
|
||||||
Complex renderers often use [Powerline's slant](https://github.com/ryanoasis/powerline-extra-symbols)
|
|
||||||
symbols, and therefore require use of a Powerline font, such as [Fira Code](https://github.com/tonsky/FiraCode).
|
|
||||||
|
|
||||||
## Libraries
|
|
||||||
|
|
||||||
- [pico-args](https://crates.io/crates/pico-args)
|
|
||||||
- [termion](https://crates.io/crates/termion)
|
|
||||||
|
|
||||||
|
|
11
src/color.rs
11
src/color.rs
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
use termion::color::{ Bg, Fg, Rgb, Reset };
|
use termion::color::{ Fg, Rgb, Reset };
|
||||||
|
|
||||||
pub type Color = Fg<Rgb>;
|
pub type Color = Fg<Rgb>;
|
||||||
pub type Colors = Vec<Fg<Rgb>>;
|
pub type Colors = Vec<Fg<Rgb>>;
|
||||||
|
@ -8,19 +8,10 @@ pub static BLACK: Color = Fg(Rgb(0x00, 0x00, 0x00));
|
||||||
pub static WHITE: Color = Fg(Rgb(0xFF, 0xFF, 0xFF));
|
pub static WHITE: Color = Fg(Rgb(0xFF, 0xFF, 0xFF));
|
||||||
|
|
||||||
pub static RESET: Fg<Reset> = Fg(Reset);
|
pub static RESET: Fg<Reset> = Fg(Reset);
|
||||||
pub static RESET_BG: Bg<Reset> = Bg(Reset);
|
|
||||||
|
|
||||||
/// produces a termion foreground color from the provided integer
|
|
||||||
pub fn rgb(hex: u32) -> Color {
|
pub fn rgb(hex: u32) -> Color {
|
||||||
let [_, r, g, b] = hex.to_be_bytes();
|
let [_, r, g, b] = hex.to_be_bytes();
|
||||||
|
|
||||||
Fg(Rgb(r, g, b))
|
Fg(Rgb(r, g, b))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// produces a termion background color from the provided integer
|
|
||||||
pub fn bg(hex: u32) -> Bg<Rgb> {
|
|
||||||
let [_, r, g, b] = hex.to_be_bytes();
|
|
||||||
|
|
||||||
Bg(Rgb(r, g, b))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -5,32 +5,11 @@ use crate::draw;
|
||||||
use crate::flag;
|
use crate::flag;
|
||||||
use crate::variant;
|
use crate::variant;
|
||||||
|
|
||||||
/// vertically stacking eighths
|
pub fn progress() {
|
||||||
pub static V_EIGHTH: [char; 7] = ['▁', '▂', '▃', '▄', '▅', '▆', '▇'];
|
let philadelphia = variant::philadelphia();
|
||||||
/// horizontally stacking eighths
|
let trans = flag::transgender();
|
||||||
pub static H_EIGHTH: [char; 7] = ['▏', '▎', '▍', '▌', '▋', '▊', '▉'];
|
|
||||||
|
|
||||||
/// shading by intensity
|
|
||||||
pub static SHADING: [char; 3] = ['░', '▒', '▓'];
|
|
||||||
|
|
||||||
/// 2/3 slope slant
|
|
||||||
pub static SLANT_23: [char; 2] = ['🭒', '🭏'];
|
|
||||||
|
|
||||||
pub fn progress() -> Colors {
|
|
||||||
let red = bg(0xE50000);
|
|
||||||
let orange = bg(0xFF8D00);
|
|
||||||
let yellow = bg(0xFFEE00);
|
|
||||||
let green = bg(0x028121);
|
|
||||||
let blue = bg(0x004CFF);
|
|
||||||
let purple = bg(0x770088);
|
|
||||||
|
|
||||||
// we need these colors in both fg & bg; just hold the integers for now
|
|
||||||
let black: u16 = 0;
|
|
||||||
let brown: u16 = 0x784F17;
|
|
||||||
let pink: u16 = 0xEAACB8;
|
|
||||||
let white: u16 = 0xFFFFFF;
|
|
||||||
|
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// everything below this point is in alphabetical order
|
// everything below this point is in alphabetical order
|
||||||
|
@ -57,35 +36,18 @@ pub fn demisexual() {
|
||||||
// BLACK triangle cutin
|
// BLACK triangle cutin
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn disability() {
|
|
||||||
let gray = bg(0x575757);
|
|
||||||
|
|
||||||
let green = rgb(0x3AAD7D);
|
|
||||||
let blue = rgb(0x79BFE0);
|
|
||||||
let white = rgb(0xE8E8E8);
|
|
||||||
let yellow = rgb(0xEDDB76);
|
|
||||||
let red = rgb(0xCD7281);
|
|
||||||
|
|
||||||
let stripe = [red, yellow, white, blue, green];
|
|
||||||
|
|
||||||
// 2/3 slant stripes with gray background
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn intersex() -> Colors {
|
pub fn intersex() -> Colors {
|
||||||
let yellow = bg(0xFFDA00);
|
let yellow = rgb(0xFFDA00);
|
||||||
let purple = rgb(0x7A00AC);
|
let purple = rgb(0x7A00AC);
|
||||||
|
|
||||||
let block = " ";
|
let stripe = draw::BLOCK.repeat(9);
|
||||||
let stripe = block.repeat(9);
|
let part = draw::BLOCK.repeat(4);
|
||||||
let part = block.repeat(4);
|
|
||||||
|
|
||||||
let lines = vec![
|
println!(
|
||||||
format!("{yellow}{stripe}"),
|
"{yellow}{stripe}\n{part}{purple}{}O{}{yellow}{part}\n{stripe}{RESET}",
|
||||||
format!("{part}{purple}O{part}"),
|
yellow.0.bg_string(),
|
||||||
format!("{stripe}")
|
RESET.0.bg_str()
|
||||||
];
|
);
|
||||||
|
|
||||||
draw::lines(lines, false);
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
28
src/draw.rs
28
src/draw.rs
|
@ -9,7 +9,7 @@ use termion::{
|
||||||
raw::IntoRawMode
|
raw::IntoRawMode
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::color::{ RESET, RESET_BG, Colors };
|
use crate::color::{ RESET, Colors };
|
||||||
|
|
||||||
pub static BLOCK: &str = "█";
|
pub static BLOCK: &str = "█";
|
||||||
pub static UHALF: &str = "▀";
|
pub static UHALF: &str = "▀";
|
||||||
|
@ -61,29 +61,3 @@ pub fn small(colors: Colors) {
|
||||||
stdout.flush().ok();
|
stdout.flush().ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lines(lines: Vec<String>, hold: bool) {
|
|
||||||
let mut stdout = io::stdout().into_raw_mode().unwrap();
|
|
||||||
|
|
||||||
let count = lines.len() as u16;
|
|
||||||
for _ in 0..count { write!(stdout, "\n").ok(); }
|
|
||||||
write!(stdout, "{}", cursor::Up(count)).ok();
|
|
||||||
|
|
||||||
if hold { write!(stdout, "{}{}", cursor::Hide, clear::All).ok(); }
|
|
||||||
|
|
||||||
let down = cursor::Down(1);
|
|
||||||
for line in lines {
|
|
||||||
let left = cursor::Left(line.len() as u16);
|
|
||||||
write!(stdout, "{line}{left}{down}").ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
write!(stdout, "{RESET}{RESET_BG}").ok();
|
|
||||||
stdout.flush().ok();
|
|
||||||
if hold {
|
|
||||||
let stdin = io::stdin();
|
|
||||||
for _ in stdin.keys() { break; }
|
|
||||||
write!(stdout, "{}", clear::All).ok();
|
|
||||||
}
|
|
||||||
write!(stdout, "{}", cursor::Show).ok();
|
|
||||||
stdout.flush().ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -77,13 +77,10 @@ fn main() {
|
||||||
=> flag::bisexual(),
|
=> flag::bisexual(),
|
||||||
|
|
||||||
// Some("demiromantic")
|
// Some("demiromantic")
|
||||||
// => complex::demiromantic(),
|
// => flag::demiromantic(),
|
||||||
|
|
||||||
// Some("demisexual")
|
// Some("demisexual")
|
||||||
// => complex::demisexual(),
|
// => flag::demisexual(),
|
||||||
|
|
||||||
// Some("disability")
|
|
||||||
// => complex::disability();
|
|
||||||
|
|
||||||
Some("genderfluid")
|
Some("genderfluid")
|
||||||
=> flag::genderfluid(),
|
=> flag::genderfluid(),
|
||||||
|
@ -151,7 +148,6 @@ fn list_text() {
|
||||||
println!(" bi, bisexual bisexual pride flag");
|
println!(" bi, bisexual bisexual pride flag");
|
||||||
// println!(" demiromantic demiromantic pride flag");
|
// println!(" demiromantic demiromantic pride flag");
|
||||||
// println!(" demisexual demisexual pride flag");
|
// println!(" demisexual demisexual pride flag");
|
||||||
// println!(" disability disability pride flag");
|
|
||||||
println!(" gay, pride six-color rainbow flag");
|
println!(" gay, pride six-color rainbow flag");
|
||||||
println!(" genderfluid genderfluid pride flag");
|
println!(" genderfluid genderfluid pride flag");
|
||||||
println!(" genderqueer genderqueer pride flag");
|
println!(" genderqueer genderqueer pride flag");
|
||||||
|
|
Loading…
Reference in a new issue