From d8835327fcc498795ac66bed330e741cef12ce29 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 7 Feb 2018 22:15:57 +0000 Subject: implement colour setting operations in render --- src/graphics_state.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/graphics_state.h') diff --git a/src/graphics_state.h b/src/graphics_state.h index ec158e0..e5cc2bf 100644 --- a/src/graphics_state.h +++ b/src/graphics_state.h @@ -29,16 +29,29 @@ struct graphics_state_color { enum graphics_state_colorspace space; union { float gray; /* default is 0 - black */ - float rgb[3]; - float cmyk[3]; - }; + struct { + float r; + float g; + float b; + } rgb; + struct { + float c; + float m; + float y; + float k; + } cmyk; + } u; }; struct graphics_state_param { float ctm[6]; /* current transform matrix */ /* clipping path */ - struct graphics_state_color stroke_colour; - struct graphics_state_color other_colour; + struct { + struct graphics_state_color colour; + } stroke; + struct { + struct graphics_state_color colour; + } other; /* text state */ float line_width; unsigned int line_cap; -- cgit v1.2.3