mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-22 17:44:22 +00:00
Add CardRarity::color()
This commit is contained in:
parent
97899f3ca2
commit
85aac42dd2
1 changed files with 14 additions and 0 deletions
|
@ -50,6 +50,20 @@ impl CardRarity {
|
|||
CardRarity::Unsupported => "",
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the color associated with this [`CardRarity`].
|
||||
///
|
||||
/// Used for example to determine the color of the Discord embed.
|
||||
pub fn color(&self) -> u32 {
|
||||
match self {
|
||||
CardRarity::None => 0x202225,
|
||||
CardRarity::Common => 0x1e6a49,
|
||||
CardRarity::Rare => 0x244778,
|
||||
CardRarity::Epic => 0x502970,
|
||||
CardRarity::Champion => 0x81541f,
|
||||
CardRarity::Unsupported => 0xff0000,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue