Skip to content

Latest commit

Β 

History

678 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lymui 🌈

Lymui is a color library which allows you to convert an RGB color to an other color (see the supported list of colors below).

Supported colors

Color Supported
Rgb βœ…
Ansi βœ…
Cymk βœ…
Grayscale βœ…
Hex βœ…
Hsl βœ…
Hue βœ…
Hwb βœ…
Ycbcr βœ…
Yuv βœ…
Xyz βœ…
Adobe RGB βœ…
sRGB βœ…
Hcl βœ…
Hunter lab βœ…
Cie Lab βœ…
Lch Lab βœ…
Luv βœ…
Oklab βœ…
Oklach βœ…
rec.709 βœ…
rec.2020 βœ…
rec.2100 (PQ) βœ…
Xyy βœ…
Tone βœ…
Ycocg βœ…
Ictcp βœ…

Usage

All colors start from the Rgb compatible color type. You can then convert it to any other color type using the From trait. For an Xyz color, you can convert it to any type based on the lumens type e.g: D65, D50, D75.

[dependencies]
lymui = "0.2.5"

Below is a code example of converting an Rgb color to Xyz using the D65 lumens type.

use lymui::{prelude::*, from_rgb_space_to_xyz_space};

fn main() {
    let rgb = Rgb {
        r: 255,
        g: 255,
        b: 255,
    };

    // Convert an `Rgb` color to `Xyz` using the `D65` lumens type.
    let xyz = Xyz::from_rgb(rgb.clone(), Kind::D65);

    // You can also use the more convenient function to convert a color e.g:
    let xyz2 = from_rgb_space_to_xyz_space::<Rgb, Xyz>(rgb, Kind::D65);
}

Examples

An example is available in the example folder. You can run it by using the command below

cargo run --example example

About

A small library for converting colors for different color space 🌈

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages