C4PlayerInfoListBox.cpp File Reference
Include dependency graph for C4PlayerInfoListBox.cpp:

Go to the source code of this file.


DWORD GenerateRandomPlayerColor (int32_t iTry)

Function Documentation

◆ GenerateRandomPlayerColor()

DWORD GenerateRandomPlayerColor ( int32_t  iTry)

Definition at line 32 of file C4PlayerInfoConflicts.cpp.

References C4RGB, and UnsyncedRandom().

Referenced by C4PlayerInfoListAttributeConflictResolver::~C4PlayerInfoListAttributeConflictResolver().

33 {
34  // generate a random one biased towards max channel luminance
35  // (for greater color difference and less gray-ish colors)
36  return C4RGB(std::min<int>(UnsyncedRandom(302), 256), std::min<int>(UnsyncedRandom(302), 256), std::min<int>(UnsyncedRandom(302), 256));
37 }
uint32_t UnsyncedRandom()
Definition: C4Random.cpp:58
#define C4RGB(r, g, b)
Definition: StdColors.h:26
Here is the call graph for this function:
Here is the caller graph for this function: