Dawn/src/dawn/display/Color.hpp

35 lines
1005 B
C++

// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "dawnlibs.hpp"
namespace Dawn {
struct Color {
uint8_t r, g, b, a;
glm::vec4 precision() {
return {
(float_t)r / 255.0f,
(float_t)g / 255.0f,
(float_t)b / 255.0f,
(float_t)a / 255.0f
};
}
};
#define COLOR_WHITE { 255, 255, 255, 255 }
#define COLOR_RED { 255, 0, 0, 255 }
#define COLOR_GREEN { 0, 255, 0, 255 }
#define COLOR_BLUE { 0, 0, 255, 255 }
#define COLOR_BLACK { 0, 0, 0, 255 }
#define COLOR_MAGENTA { 255, 0, 255, 255 }
#define COLOR_DARK_GREY { 50, 50, 50, 255 }
#define COLOR_LIGHT_GREY { 204, 204, 204, 255 }
#define COLOR_CORNFLOWER_BLUE { 255, 255, 237, 255 }
#define COLOR_WHITE_TRANSPARENT { 255, 255, 255, 0 }
#define COLOR_BLACK_TRANSPARENT { 0, 0, 0, 0 }
#define COLOR_TRANSPARENT COLOR_BLACK_TRANSPARENT
}