aboutsummaryrefslogtreecommitdiff
path: root/client/src/world/helper.rs
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-06-09 16:01:55 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-06-09 16:01:55 +0200
commitc1b5937b64649904689fea8da2c06e0b66ae8332 (patch)
tree458e7a8b5e6489e26e58ffbb134fd40c7f04dd5e /client/src/world/helper.rs
parent024a73e9575980b40c93d5f60c0e4e3f8e54187c (diff)
downloadtwclient-c1b5937b64649904689fea8da2c06e0b66ae8332.tar
twclient-c1b5937b64649904689fea8da2c06e0b66ae8332.tar.bz2
twclient-c1b5937b64649904689fea8da2c06e0b66ae8332.tar.zst
asdfss
Diffstat (limited to 'client/src/world/helper.rs')
-rw-r--r--client/src/world/helper.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/src/world/helper.rs b/client/src/world/helper.rs
new file mode 100644
index 0000000..fab452a
--- /dev/null
+++ b/client/src/world/helper.rs
@@ -0,0 +1,18 @@
+use std::fmt::Display;
+
+#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
+pub struct Color {
+ pub a: u8,
+ pub r: u8,
+ pub g: u8,
+ pub b: u8,
+}
+
+impl Display for Color {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.write_fmt(format_args!(
+ "#{:02x}{:02x}{:02x}{:02x}",
+ self.r, self.g, self.b, self.a
+ ))
+ }
+}