| 46 | } |
| 47 | |
| 48 | COLORREF GetRandomColor(double s, double v) |
| 49 | { |
| 50 | static bool randomize = (std::srand(GetTickCount()), true); |
| 51 | static const double ratio = (1 + std::sqrt(5.))/2 - 1; |
| 52 | // use golden ratio |
| 53 | static double h = static_cast<double>(std::rand()) / (RAND_MAX + 1); |
| 54 | |
| 55 | h += ratio; |
| 56 | if (h >= 1) |
| 57 | h = h - 1; |
| 58 | return HsvToRgb(h, s, v); |
| 59 | } |
| 60 | |
| 61 | COLORREF GetRandomBackColor() |
| 62 | { |
no test coverage detected