Crate chocodye

source ·
Expand description

A Rust library for changing the color of the chocobos’ plumage in Final Fantasy XIV.

§Features

  • fluent: provides access to localized fruit and color names, but only for English, French, German and Japanese.

  • truecolor: enables colored text to be displayed on terminals supporting 24-bit color.

These two features are enabled by default.

§Examples

To print all the dyes:

use chocodye::{Dye, Lang};

let bundle = Lang::English.into_bundle();

let mut dyes = Dye::VALUES;
dyes.sort_unstable_by_key(|dye| 255 - dye.luma());

for dye in dyes {
    print!("{} ", dye.ansi_color_name(&bundle));
}

println!();

To print all the dyes by category:

use chocodye::{Category, Lang};

let bundle = Lang::English.into_bundle();

for category in Category::VALUES {
    print!("{} -- ", category.ansi_full_name(&bundle));

    for dye in category.dyes() {
        print!("{} ", dye.ansi_color_name(&bundle));
    }

    println!();
}

To print a menu:

use chocodye::{Dye, make_meal, make_menu, SnackList};

let meal = make_meal(Dye::SnowWhite, Dye::BoneWhite);
let menu = make_menu(Dye::SnowWhite, SnackList::from(meal.as_slice()));

println!("{:?}", menu);

Macros§

  • messagefluent
    Formats a Fluent message fail-safely. Missing keys are formatted arbitrarily.

Structs§

Enums§

  • A category of dyes with similar hues.
  • A color that can be found as the plumage of a chocobo.
  • A language officially supported by Final Fantasy XIV. Can be converted into a FluentBundle.
  • An error that can be returned when parsing a hexadecimal color.
  • A type of bitter fruit that changes the hue of the chocobos that eat it.

Functions§

Type Aliases§