simplers

Crates.iosimplers
lib.rssimplers
version1.0.10
sourcesrc
created_at2024-05-31 08:11:08.914913
updated_at2024-06-03 09:34:22.839514
descriptionSimplification of too complex stuff in rust
homepage
repositoryhttps://github.com/coderspark/simplers
max_upload_size
id1257774
size5,756
CoderSpark (coderspark)

documentation

README

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

Commit count: 4

cargo fmt