#ifndef __G_COLOR_H__
#define __G_COLOR_H__

#include <gear/base.h>

typedef struct g_color {
    u8 r;
    u8 g;
    u8 b;
    u8 a;
} g_color;

#define G_COLOR_TO_U32(color) *((u32*)(&color))
#define G_COLOR_TO_FLOAT_ARR(color) { color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, color.a / 255.0f }
#define G_FLOAT_ARR_TO_COLOR(float) { (u8)(float[0] * 255), (u8)(float[1] * 255), (u8)(float[2] * 255), (u8)(float[3] * 255) } 

#define G_WHITE     (g_color){ 255, 255, 255, 255 }
#define G_BLACK     (g_color){ 0, 0, 0, 255 }

#define G_RED       (g_color){ 255, 0, 0, 255 }
#define G_GREEN     (g_color){ 0, 255, 0, 255 }
#define G_BLUE      (g_color){ 0, 0, 255, 255 }

#define G_YELLOW    (g_color){ 255, 255, 0, 255 }
#define G_CYAN      (g_color){ 0, 255, 255, 255 }
#define G_MAGENTA   (g_color){ 255, 0, 255, 255 }

#endif
