#color #input #complex #macro #weight

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

#304 in Command-line interface

Download history 35/week @ 2024-07-26 82/week @ 2024-09-27 11/week @ 2024-10-04

402 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