From 29efc28aec91f7b9ca20865d54a9d570f409476e Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 28 Aug 2019 15:42:07 +0200 Subject: Color as union Replace int color with union to have the posibility to set them with hexcode and retrive each color separatly as the member of a struct. --- header.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'header.h') diff --git a/header.h b/header.h index fba32c6..34d616b 100644 --- a/header.h +++ b/header.h @@ -10,12 +10,22 @@ # define REAL_RANGE 4.0 # define IMAG_RANGE 4.0 -# define MAX_ITERATION 35 +# define MAX_ITERATION 50 # define ESCAPE_VALUE 2 -/* typedef long double LDouble; */ +typedef unsigned char Byte; +typedef int ColorHexcode; -typedef int Color; +typedef union +{ + ColorHexcode hexcode; + struct + { + Byte b; + Byte g; + Byte r; + } rgb; +} Color; typedef struct { @@ -34,6 +44,7 @@ typedef struct double real_range; double imag_range; Color *palette; + Color in_set_color; } GState; // mandelbrot.c -- cgit