diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2022-12-12 21:09:32 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2022-12-14 00:34:31 +0000 |
| commit | 712abb7719440e132750fedf1bab60db9c1023fd (patch) | |
| tree | 24bf75ee783fef4b15d3cb75da1546bb011205ee | |
| parent | 43bea5f6f20b4a58b083ccb0b380e78180017128 (diff) | |
| download | puzzles-712abb7719440e132750fedf1bab60db9c1023fd.zip puzzles-712abb7719440e132750fedf1bab60db9c1023fd.tar.gz puzzles-712abb7719440e132750fedf1bab60db9c1023fd.tar.bz2 puzzles-712abb7719440e132750fedf1bab60db9c1023fd.tar.xz | |
Add an assertion that all colours are within range
Because I know I'm going to mess this up at some point.
| -rw-r--r-- | midend.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1348,6 +1348,9 @@ float *midend_colours(midend *me, int *ncolours) ret[i*3 + 1] = g / 255.0F; ret[i*3 + 2] = b / 255.0F; } + assert(0.0F <= ret[i*3 + 0] && ret[i*3 + 0] <= 1.0F); + assert(0.0F <= ret[i*3 + 1] && ret[i*3 + 1] <= 1.0F); + assert(0.0F <= ret[i*3 + 2] && ret[i*3 + 2] <= 1.0F); } } |