MCPcopy Create free account
hub / github.com/ColorCop/ColorCop / OnColorRandom

Method OnColorRandom

ColorCop/ColorCopDlg.cpp:2347–2362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2345}
2346
2347void 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
2364void CColorCopDlg::OnColorReverse() {
2365 // Invert the current RGB color (per‑channel): new = 255 - old.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected