{"id":17079079,"url":"https://github.com/curlpipe/lliw","last_synced_at":"2025-04-12T20:34:40.202Z","repository":{"id":47411664,"uuid":"342335785","full_name":"curlpipe/lliw","owner":"curlpipe","description":"Text colours and styles for your terminal with no additional dependencies","archived":false,"fork":false,"pushed_at":"2022-03-24T00:03:09.000Z","size":30,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T14:51:04.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curlpipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-25T18:09:21.000Z","updated_at":"2024-09-14T11:50:35.000Z","dependencies_parsed_at":"2022-07-25T03:15:07.874Z","dependency_job_id":null,"html_url":"https://github.com/curlpipe/lliw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curlpipe%2Flliw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curlpipe%2Flliw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curlpipe%2Flliw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curlpipe%2Flliw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curlpipe","download_url":"https://codeload.github.com/curlpipe/lliw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631110,"owners_count":21136547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T12:24:33.414Z","updated_at":"2025-04-12T20:34:40.183Z","avatar_url":"https://github.com/curlpipe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lliw \n*Roughly pronounced hlew*, it is \"colour\" in Welsh\n\nLliw provides colours for your terminal, with no additional dependencies.\n\n# Aims\n\n- No dependencies\n- Works in `#![no_std]` environments\n- Provides colours and styles in a non-opinionated way\n- Provides multiple ways to use\n- Doesn't make your code look like trash\n- Doesn't assume how you'll use the crate\n\n# Installation\n\nIf you have `cargo-edit` installed, it's as easy as:\n\n```sh\ncargo add lliw\n```\n\nif you don't have `cargo-edit` you can add the following to your `Cargo.toml` file\n\n```toml\n[dependencies]\nlliw = \"0\"\n```\n\n# Example usage\n\n```rust\nuse lliw::{Fg, Bg, Style, Reset};\n\nfn main() {\n    // Prints \"Blue\" in a blue colour\n    println!(\"{}Blue{}\", Fg::Blue, Fg::Reset);\n    // Prints \"Bold\" in bold\n    println!(\"{}Bold{}\", Style::Bold, Style::NoBold);\n    // Prints \"Green\" with a green background\n    println!(\"{}Green{}\", Bg::Green, Bg::Reset);\n    \n    // You can even use it in more complicated ways\n    println!(\n        \"{}{}Attention!{}{} You have {}{}1{}{} new message\",\n        Style::Underline, Fg::Yellow,\n        Style::NoUnderline, Fg::Reset,\n        Bg::White, Fg::Black,\n        Bg::Reset, Fg::Reset,\n    );\n    \n    // You can make them go over the top of each other too\n    println!(\n        \"{}Hello{} Wor{}ld! My{} Name{} {}Is{} Lliw{}\",\n        Style::Italic, Fg::LightPurple, \n        Bg::Black, Fg::Reset, Style::NoItalic, \n        Style::Underline, Bg::Reset, Reset\n    );\n\n    // Don't like these long formatting macros? You can use it like this too!\n    print!(\"{}\", Fg::LightRed);\n    print!(\"Hello\\nThere!\");\n    print!(\"{}\\n\", Reset);\n\n    // You can also use an RGB value if you want 24-bit colours\n    println!(\n        \"{}R{}a{}i{}n{}b{}o{}w{}\",\n        Fg::Rgb(255, 0, 0),\n        Fg::Rgb(255, 128, 0),\n        Fg::Rgb(255, 255, 0),\n        Fg::Rgb(0, 255, 0),\n        Fg::Rgb(0, 255, 255),\n        Fg::Rgb(128, 0, 255),\n        Fg::Rgb(255, 0, 128),\n        Fg::Reset,\n    );\n}\n```\n\n# Usage\n\nThere are 3 enums provided with lliw, `Fg`, `Bg` and `Style`.\nThere is also 1 struct, `Reset`.\n\n- `Fg` - Control the text colour\n\t+ Consists of the types: Rgb, Black, Red, Green, Yellow, Blue, Purple, Cyan, White,\n    LightBlack, LightRed, LightGreen, LightYellow,\n    LightBlue, LightPurple, LightCyan, LightWhite and Reset.\n    + The colours are reset using the `Reset` variant.\n    + You can use the Rgb variant to provide true 24-bit colour values\n- `Bg` - Control the text background colour\n\t+ Consists of the types: Rgb, Black, Red, Green, Yellow, Blue, Purple, Cyan, White,\n    LightBlack, LightRed, LightGreen, LightYellow,\n    LightBlue, LightPurple, LightCyan, LightWhite and Reset.\n    + The colours are reset using the `Reset` variant.\n    + You can use the Rgb variant to provide true 24-bit colour values\n- `Style` - Control the text styles\n\t+ Consists of the types: Bold, NoBold, Underline, NoUnderline, Strike, NoStrike, Italic, NoItalic, Inverse, NoInverse, Faint and NoFaint.\n\t\t+ Bold: Make the text bold, can be terminated with `NoBold`\n\t\t+ Underline: Make the text have an underline, can be terminated with `NoUnderline`\n\t\t+ Italic: Make the text go italic, can be terminated with `NoItalic`\n\t\t+ Inverse: Inverse the text colours, can be terminated with `NoInverse`\n\t\t+ Faint: Make the text fainter, can be terminated with `NoFaint`\n\t\t+ Strike: Make the text have a strike through it, can be terminated with `NoStrike`\n- `Reset` - This is a full reset struct that resets foreground, background and style when used.\n\nBe sure to check out the docs over at https://docs.rs/lliw\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurlpipe%2Flliw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurlpipe%2Flliw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurlpipe%2Flliw/lists"}