2 个不稳定版本

0.2.1 2021年2月25日
0.2.0 2021年2月25日
0.1.0 2021年2月25日

#3 in #cmyk

AGPL-3.0

17KB
299 代码行数(不含注释)

color_conv

color_conv is a simple and lightweight helper library for easily and programmatically converting between the RGB, CMYK, HSL, and hex color formats.

[dependencies]
color_conv = "0.2.1"

示例

use color_conv::Color;
use color_conv::Cmyk;
use color_conv::Rgb;

let cyan = Cmyk::new_unchecked(100, 0, 0, 0);
let cyan_rgb = cyan.to_rgb();

assert_eq!(Rgb::new(0, 255, 255), cyan_rgb);

lib.rs:

color_conv is a helper library for easily and programmatically converting between the RGB, CMYK, HSL, and hex color formats.

[dependencies]
color_conv = "0.2.1"

示例

use color_conv::Color;
use color_conv::Cmyk;
use color_conv::Rgb;

let cyan = Cmyk::new_unchecked(100, 0, 0, 0);
let cyan_rgb = cyan.to_rgb();

assert_eq!(Rgb::new(0, 255, 255), cyan_rgb);

依赖

~255–710KB
~17K SLoC