summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Graphics/Color.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-02-25 09:07:37 +0800
committerchai <chaifix@163.com>2019-02-25 09:07:37 +0800
commit684f71790401727cc45f4dad1822ddae46305072 (patch)
tree75733807914fa799521d1d6a8a450982fdef9124 /Source/Asura.Engine/Graphics/Color.cpp
parentc97d8eb7f0900cb6895acb2e5bdce1044931b91a (diff)
+widgets
Diffstat (limited to 'Source/Asura.Engine/Graphics/Color.cpp')
-rw-r--r--Source/Asura.Engine/Graphics/Color.cpp132
1 files changed, 132 insertions, 0 deletions
diff --git a/Source/Asura.Engine/Graphics/Color.cpp b/Source/Asura.Engine/Graphics/Color.cpp
index e69de29..a047f53 100644
--- a/Source/Asura.Engine/Graphics/Color.cpp
+++ b/Source/Asura.Engine/Graphics/Color.cpp
@@ -0,0 +1,132 @@
+#include "Color.h"
+
+namespace AsuraEngine
+{
+ namespace Graphics
+ {
+
+ Color32::Color32()
+ {
+ r = g = b = a = 0;
+ }
+
+ Color32::Color32(const Color32& c)
+ {
+ r = c.r;
+ g = c.g;
+ b = c.b;
+ a = c.a;
+ }
+
+ Color32::Color32(const Color& c)
+ {
+ r = 255.f * c.r;
+ g = 255.f * c.g;
+ b = 255.f * c.b;
+ a = 255.f * c.a;
+ }
+
+ Color32::Color32(byte r, byte g, byte b, byte a)
+ {
+ this->r = r;
+ this->g = g;
+ this->b = b;
+ this->a = a;
+ }
+
+ int Color32::l_GetRed(lua_State* L)
+ {
+
+ }
+
+ int Color32::l_GetGreen(lua_State* L)
+ {
+
+ }
+
+ int Color32::l_GetBlue(lua_State* L)
+ {
+
+ }
+
+ int Color32::l_GetAlpha(lua_State* L)
+ {
+
+ }
+
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ Color::Color()
+ {
+ r = g = b = a = 0;
+ }
+
+ Color::Color(const Color& c)
+ {
+ r = c.r;
+ g = c.g;
+ b = c.b;
+ a = c.a;
+ }
+
+ Color::Color(float r, float g, float b, float a)
+ {
+ this->r = r;
+ this->g = g;
+ this->b = b;
+ this->a = a;
+ }
+
+ Color::Color(const Color32& c)
+ {
+ r = c.r / 255.f;
+ g = c.g / 255.f;
+ b = c.b / 255.f;
+ a = c.a / 255.f;
+ }
+
+ Color Color::operator *(const Color& c)
+ {
+ r *= c.r;
+ g *= c.g;
+ b *= c.b;
+ a *= c.a;
+ }
+
+ int Color::l_GetRed(lua_State* L)
+ {
+
+ }
+
+ int Color::l_GetGreen(lua_State* L)
+ {
+
+ }
+
+ int Color::l_GetBlue(lua_State* L)
+ {
+
+ }
+
+ int Color::l_GetAlpha(lua_State* L)
+ {
+
+ }
+
+ int Color::l_Add(lua_State* L)
+ {
+
+ }
+
+ int Color::l_Minus(lua_State* L)
+ {
+
+ }
+
+ int Color::l_Multiply(lua_State* L)
+ {
+
+ }
+
+ }
+} \ No newline at end of file