| 2345 | } |
| 2346 | |
| 2347 | void CColorCopDlg::OnColorRandom() { |
| 2348 | // Generates a random color and updates |
| 2349 | // current decimal value MOD 256 - make a random value from 0 to 255 |
| 2350 | // Thread-safe random number generation |
| 2351 | static thread_local std::mt19937 generator(std::random_device{}()); // NOLINT |
| 2352 | std::uniform_int_distribution<int> distribution(RGB_MIN, RGB_MAX); |
| 2353 | |
| 2354 | m_Reddec = distribution(generator); |
| 2355 | m_Greendec = distribution(generator); |
| 2356 | m_Bluedec = distribution(generator); |
| 2357 | |
| 2358 | SetStatusBarText(IDS_RANDOMCOLOR, 0); |
| 2359 | CalcColorPal(); |
| 2360 | OnconvertRGB(); |
| 2361 | OnCopytoclip(); |
| 2362 | } |
| 2363 | |
| 2364 | void CColorCopDlg::OnColorReverse() { |
| 2365 | // Invert the current RGB color (per‑channel): new = 255 - old. |
nothing calls this directly
no outgoing calls
no test coverage detected