#color #weight #input #complex #weigh #found #input-color

simplers

Simplification of too complex stuff in rust

11 stable releases

1.0.10 Jun 3, 2024
1.0.8 May 31, 2024
0.1.0 May 31, 2024

#8 in #weight

Download history 603/week @ 2024-05-30 49/week @ 2024-06-06

652 downloads per month

Apache-2.0

6KB
87 lines

Simple.rs

Simple.rs is a crate i made to make things in rust that i found too complicated a little easier.

Still new to rust but this was fun to make.

Features

The input function

Definition:

pub fn input<'a>(s: impl Into<Option<&'a str>>) -> String{

}

It lets you easily do input with 1 function instead of printing, flushing, reading the line, and then trimming the newline after the input

COLOR STRUCT

Colours

  • BLACK
  • RED
  • ORANGE
  • YELLOW
  • LIGHTGREEN
  • DARKGREEN
  • MINT
  • CYAN
  • LIGHTBLUE
  • SKYBLUE
  • BLUE
  • DARKBLUE
  • DEEPPURPLE
  • PURPLE
  • VIOLET
  • MAGENTA
  • WARMPINK
  • WATERMELON
  • LIGHTGRAY
  • DARKGRAY

any others:

Color {
    r: <red>,
    g: <green>,
    b: <blue>
}

Color function

Definition:

fn color(text: &'static str, clr: Color) -> String {

}

Color text

Weigh macro

Definition:

macro_rules! weigh {
    ($s:expr, $($args:expr),*) => {{

    }}
}

Add weight to text such as bold, or italic just add more Weights for multiple at once

Weight struct

  • BOLD
  • DIM
  • ITALIC
  • UNDERLINED
  • SLOWBLINK
  • FASTBLINK

Those are all the weights :)

And.. Input_color

Definition:

fn color(iptext: &'static str, clr: Color) -> String {
    
}

input but coloured

No runtime deps