diff options
| author | suyambulingamrm <suyambu.rm@samsung.com> | 2014-06-26 19:46:06 +0530 |
|---|---|---|
| committer | suyambulingamrm <suyambu.rm@samsung.com> | 2014-06-26 19:46:06 +0530 |
| commit | 440e88a2a69871a8b3b82a8572eade56282dd1b8 (patch) | |
| tree | 356129e8b5e32b66d8d0a463368675e775453fed /src/shapes.cpp | |
| parent | 7ccd77641624be8fefe8810867743fed493e9470 (diff) | |
Issue #105. Add utility function generate_random_color()
Diffstat (limited to 'src/shapes.cpp')
| -rw-r--r-- | src/shapes.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shapes.cpp b/src/shapes.cpp index d9cd904..afb6739 100644 --- a/src/shapes.cpp +++ b/src/shapes.cpp @@ -91,6 +91,15 @@ shape_randomize(shapes_t *shape) // TODO } +void +generate_random_color(double &red, double &green, double &blue, double &alpha) +{ + red = (double)rand()/RAND_MAX; + green = (double)rand()/RAND_MAX; + blue = (double)rand()/RAND_MAX; + alpha = (double)rand()/RAND_MAX; +} + shape_type_t generate_random_shape() { |