Simplify the color system by using a simple Values system for the dark to light.

This commit is contained in:
Zed A. Shaw 2024-09-19 11:44:34 -04:00
parent 3cb4fcfeb5
commit 581e5b4a60
2 changed files with 45 additions and 19 deletions

View file

@ -11,16 +11,23 @@
using std::string;
enum class Value {
BLACK=0, DARK_DARK, DARK_MID,
DARK_LIGHT, MID, LIGHT_DARK, LIGHT_MID,
LIGHT_LIGHT, WHITE, TRANSPARENT
};
constexpr int FPS=30;
constexpr int X_DIM = 1920 / 2;
constexpr int Y_DIM = 1080 / 2;
constexpr int TEXT_SIZE = 48;
constexpr Value TEXT_COLOR = Value::LIGHT_LIGHT;
constexpr int Y_LINES = 23;
constexpr int X_ROWS = 48;
const sf::Color OUTLINE(50, 200, 25);
constexpr int THICKNESS=10;
const sf::Color FILL = sf::Color::Transparent;
constexpr Value BOX_OUTLINE = Value::MID;
constexpr int BOX_THICKNESS=10;
constexpr Value BOX_FILL = Value::TRANSPARENT;
class SoundQuip {
public:
@ -64,12 +71,14 @@ public:
void update_entities();
void update_log(std::vector<string> &lines);
sf::RectangleShape box(int x, int y, int width, int height,
sf::Color fill=FILL,
sf::Color outline=OUTLINE,
int thickness=THICKNESS);
sf::Color value(Value level);
void write_text(int x, int y, string content, float size_mult=1.0f);
sf::RectangleShape box(int x, int y, int width, int height,
Value fill=BOX_FILL,
Value outline=BOX_OUTLINE,
int thickness=BOX_THICKNESS);
void write_text(int x, int y, string content, float size_mult=1.0f, Value color=TEXT_COLOR);
void Window_update();
};