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§
- message
fluent - Formats a Fluent message fail-safely. Missing keys are formatted arbitrarily.
Structs§
- Parse
Lang Error - An error that can be returned when parsing an Unicode Language Identifier.
- Rgb
- A color represented by three
u8components. - Snack
List - An unsorted list of
Snack, can be considered anEnumMap<Snack, u8>.
Enums§
- Category
- A category of dyes with similar hues.
- Dye
- A color that can be found as the plumage of a chocobo.
- Lang
- A language officially supported by Final Fantasy XIV.
Can be converted into a
FluentBundle. - Parse
HexError - An error that can be returned when parsing a hexadecimal color.
- Snack
- A type of bitter fruit that changes the hue of the chocobos that eat it.
Functions§
- ansi_
text - Changes the background color of a string using three ANSI escape codes if the terminal support truecolors.
- make_
meal - Creates a vector of
Snack, that when fed to a chocobo, will change its plumage from oneDyeto another. - make_
menu - Reduces the complexity of a meal made with
make_mealwhile preserving the same change of plumage.
Type Aliases§
- Fluent
Bundle - A collection of messages for a given language. Obtained from
Lang::into_bundle.