Skip to content

aspnxdd/tw-colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tw-colors

Crates.io Documentation License

The complete Tailwind CSS v4 color palette as (u8, u8, u8) RGB constants for Rust.

Zero dependencies. Just constants.

Installation

cargo add tw-colors

Usage

Every color is a pub const of type RGB, which is a type alias for (u8, u8, u8):

use tw_colors::{RGB, BLUE_500, RED_400, SLATE_900};

// Use directly as an RGB tuple
let color: RGB = BLUE_500; // (43, 127, 255)

// Destructure into components
let (r, g, b) = RED_400; // (255, 100, 103)

// Pass anywhere that accepts (u8, u8, u8)
fn set_background(color: (u8, u8, u8)) { /* ... */ }
set_background(SLATE_900);

With Freya

The RGB tuples work directly with Freya:

use freya::prelude::*;
use tw_colors::BLUE_500;

fn app() -> impl IntoElement {
    rect()
        .background(BLUE_500)
        .child("Hello, Tailwind!")
}

Available Colors

All constants follow the naming pattern COLOR_SHADE, where shade is one of: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950.

Chromatic

Family Example
RED RED_500 = (251, 44, 54)
ORANGE ORANGE_500 = (255, 105, 0)
AMBER AMBER_500 = (254, 154, 0)
YELLOW YELLOW_500 = (240, 177, 0)
LIME LIME_500 = (124, 207, 0)
GREEN GREEN_500 = (0, 201, 80)
EMERALD EMERALD_500 = (0, 188, 125)
TEAL TEAL_500 = (0, 187, 167)
CYAN CYAN_500 = (0, 184, 219)
SKY SKY_500 = (0, 166, 244)
BLUE BLUE_500 = (43, 127, 255)
INDIGO INDIGO_500 = (97, 95, 255)
VIOLET VIOLET_500 = (142, 81, 255)
PURPLE PURPLE_500 = (173, 70, 255)
FUCHSIA FUCHSIA_500 = (225, 42, 251)
PINK PINK_500 = (246, 51, 154)
ROSE ROSE_500 = (255, 32, 86)

Neutrals

Family Example
SLATE SLATE_500 = (98, 116, 142)
GRAY GRAY_500 = (106, 114, 130)
ZINC ZINC_500 = (113, 113, 123)
NEUTRAL NEUTRAL_500 = (115, 115, 115)
STONE STONE_500 = (121, 113, 107)
TAUPE TAUPE_500 = (124, 109, 103)
MAUVE MAUVE_500 = (121, 105, 123)
MIST MIST_500 = (103, 120, 124)
OLIVE OLIVE_500 = (124, 124, 103)

29 color families x 11 shades = 319 constants covering the full Tailwind CSS v4 palette.

License

Licensed under either of

at your option.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages