diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d32ef21 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "println" + ] +} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index d99ae47..7f318d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,18 @@ [package] name = "picocolors" description = "rust version of picocolors" -keywords = ["cli", "colors"] +keywords = [ + "cli", + "colors", +] version = "0.1.0" -license = "MIT" edition = "2021" readme = "README.md" repository = "https://github.com/SoonIter/picocolors_rs" -authors = ["SoonIter"] +authors = [ + "SoonIter", +] +license-file = "LICENSE" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/LICENSE b/LICENSE index e4e4945..aadb717 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 SoonIter +Copyright (c) 2023-now SoonIter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index eff471b..1ce5402 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # picocolors -rust version of picocolors +rust port of [picocolors](https://github.com/alexeyraspopov/picocolors) [![crates-io](https://badgen.net/crates/v/picocolors_rs)](https://crates.io/crates/picocolors) ```rust -use picocolors::{bg_black, bold}; - +use picocolors::{bg_black, bold, formatter}; fn main() { println!("hello {}", bold(bg_black("world"))); + + let custom_blue = formatter("\x1b[34m", "\x1b[39m"); + println!("hello {}", custom_blue("world")); } ``` diff --git a/src/main.rs b/src/main.rs index e5f9981..21586be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,6 @@ use picocolors::{bg_black, bold, formatter}; fn main() { println!("hello {}", bold(bg_black("world"))); - let my_custom_blue = formatter("\x1b[0m", "\x1b[0m"); - println!("hello {:?}", my_custom_blue("world")); + let my_custom_blue = formatter("\x1b[34m", "\x1b[39m"); + println!("hello {}", my_custom_blue("world")); }