diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-08-28 15:42:07 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-08-28 15:42:07 +0200 |
| commit | 29efc28aec91f7b9ca20865d54a9d570f409476e (patch) | |
| tree | f3992781df58fd23cde830eedb4126dc899ed135 /header.h | |
| parent | df6e7cbaa0edf2df8b5f3929a2eb34fa2aa5a28c (diff) | |
| download | mandelbrot-29efc28aec91f7b9ca20865d54a9d570f409476e.tar.gz mandelbrot-29efc28aec91f7b9ca20865d54a9d570f409476e.tar.bz2 mandelbrot-29efc28aec91f7b9ca20865d54a9d570f409476e.zip | |
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.
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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 |
