Bracket-Color Examples
All of the bracket-color
examples require crossterm
for console output. You can run them with:
cd bracket-color
cargo run --example (name) --no-default-features --features crossterm
colors
The colors
example demonstrates printing to the console in a number of colors, demonstrating several of the ways in which colors can be generated (named, from floating point and byte RGB).
lerp
The lerp
example shows how to use the lerp
function, providing smooth transitions between two colors. The transition occurs in the RGB space. You can use HSV colors to lerp in that space if you wish. ("Lerp" is a common shorthand for "Linear Interpolation")
lerpit
Similar to the lerp
example, but using an iterator instead of repeated calls to the lerp
function. Bracket-color
includes an RgbLerp
iterator for this purpose.
lerpit_hsv
This is just like the lerpit
example, but using an HSV color space for interpolation via the HsvLerp
iterator.
named_color
A very simple demo printing colors obtained via RGB::named
, including a quick test of the into
conversion between colors.
shades_of_grey
This demo shows off how to use to_greyscale()
and desaturate()
on colors, providing two different methods of converting colors to greyscale.