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§
- An error that can be returned when parsing an Unicode Language Identifier.
- A color represented by three
u8
components. - An unsorted list of
Snack
, can be considered anEnumMap<Snack, u8>
.
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§
- Changes the background color of a string using three ANSI escape codes if the terminal support truecolors.
- Reduces the complexity of a meal made with
make_meal
while preserving the same change of plumage.
Type Aliases§
- A collection of messages for a given language. Obtained from
Lang::into_bundle
.