Cichlid

cichlid crate cichlid docs

A simple Rust library for managing RGB colorings. Works with no-std environments as well.

Currently this library is geared toward use in embedded systems, but does contain useful APIs that are more generally useful.

This Library is still in its infancy, and as such there may be a lack of documentation and vigorous testing.

Examples

General Color operations:

```rust use cichlid::{HSV, ColorRGB};

let red = ColorRGB::Red; let blue = ColorRGB::Blue; let mut purple = red + blue; assert_eq!(purple, ColorRGB::new(255, 0, 255));

purple.scale(128); // Scale by half assert_eq!(purple, ColorRGB::new(128, 0, 128));

purple *= 2; // Multiple all components by two assert_eq!(purple, red + blue); ```

Using HSV (Hue, Saturation, Value) and converting to ColorRGB:

```rust use cichlid::{HSV, ColorRGB};

let redhsv = HSV::new(0, 255, 255); let redrgb = ColorRGB::from(redhsv); asserteq!(red_rgb, ColorRGB::Red); ```

Creating a gradient is very easy, simply import the trait and call the method:

```rust use cichlid::{HSV, ColorRGB, GradientDirection, prelude::*}; let mut colors = [ColorRGB::Black; 100];

let start = HSV::new(0, 255, 255); let end = HSV::new(100, 255, 180); colors.gradient_fill(start, end, GradientDirection::Longest); ```

Contributing

Any and all contributions are welcome! Open up a PR to contribute some improvements. Look at the Issues tab to see what needs some help.

License

Cichlid is distributed under the terms of the MIT license. See LICENSE-MIT for details. Opening a pull requests is assumed to signal agreement with these licensing terms.