From 1dbddd7155872890a7f065c90d0e18ac6a2feed8 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 26 Jun 2019 20:33:32 +0200 Subject: colors: store as doubles, rather than uint32_t Since cairo uses doubles, we don't want to have to convert a uin32_t to double values every time we render a cell. --- terminal.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 3eb8abce..86845c2d 100644 --- a/terminal.h +++ b/terminal.h @@ -11,6 +11,8 @@ #include "tllist.h" +struct rgba { double r, g, b, a; }; + struct attributes { bool bold; bool italic; @@ -21,8 +23,8 @@ struct attributes { bool reverse; bool have_foreground; bool have_background; - uint32_t foreground; /* Only valid when have_foreground == true */ - uint32_t background; /* Only valid when have_background == true */ + struct rgba foreground; /* Only valid when have_foreground == true */ + struct rgba background; /* Only valid when have_background == true */ }; struct cell { @@ -76,8 +78,8 @@ struct grid { int col; } alt_saved_cursor; - uint32_t foreground; - uint32_t background; + struct rgba foreground; + struct rgba background; tll(struct damage) damage; tll(struct damage) scroll_damage; -- cgit v1.3