From 60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 13 Dec 2021 00:07:19 +0800 Subject: +init --- Client/Source/Graphics/Color.h | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Client/Source/Graphics/Color.h (limited to 'Client/Source/Graphics/Color.h') diff --git a/Client/Source/Graphics/Color.h b/Client/Source/Graphics/Color.h new file mode 100644 index 0000000..f7bb937 --- /dev/null +++ b/Client/Source/Graphics/Color.h @@ -0,0 +1,48 @@ +#pragma once + +struct Color +{ + Color(float r = 0, float g = 0, float b = 0, float a = 0) + { + this->r = r; + this->g = g; + this->b = b; + this->a = a; + } + void Set(float r = 0, float g = 0, float b = 0, float a = 0) + { + this->r = r; + this->g = g; + this->b = b; + this->a = a; + } + float r, g, b, a; +}; + +struct Color32 +{ + Color32(unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, unsigned char a = 0) + { + this->r = r; + this->g = g; + this->b = b; + this->a = a; + } + void Set(unsigned char r = 0, unsigned char g = 0, unsigned char b = 0, unsigned char a = 0) + { + this->r = r; + this->g = g; + this->b = b; + this->a = a; + } + + bool operator !=(const Color32& col) + { + return !(r == col.r && g == col.g && b == col.b && a == col.a); + } + + unsigned char r, g, b, a; + + static const Color32 white; +}; + -- cgit v1.1-26-g67d0