|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Centralized color palette for teams and entity materials. More...
#include <ColorPalette.hpp>
Collaboration diagram for ColorPalette:Classes | |
| struct | SlimePalette |
Static Public Member Functions | |
| static Color | getTeamColor (int index) |
| Returns a unique color for a team based on its index. Will repeat if more teams than palette size. | |
| static Color | getResourceColor (int resourceIndex) |
| Returns the designated UI/3D color for a given resource index. | |
| static SlimePalette | getSlimePalette (Color teamColor) |
| Returns a slime palette with variations based on the team color. | |
| static bool | colorEquals (Color a, Color b) |
| Utility to compare two colors for equality. | |
Static Public Attributes | |
| static constexpr Color | KEEP = {0, 0, 0, 0} |
| static constexpr int | PALETTE_SIZE = 10 |
Static Private Attributes | |
| static const Color | _teamColors [PALETTE_SIZE] |
| static const SlimePalette | _slimePalettes [PALETTE_SIZE] |
Centralized color palette for teams and entity materials.
Definition at line 8 of file ColorPalette.hpp.
|
static |
Utility to compare two colors for equality.
| a | First color. |
| b | Second color. |
Definition at line 41 of file ColorPalette.cpp.
Referenced by EntityRenderer::drawPlayer(), and getSlimePalette().
Here is the caller graph for this function:
|
static |
Returns the designated UI/3D color for a given resource index.
Definition at line 46 of file ColorPalette.cpp.
Referenced by EntityTooltipWidget::_rebuild(), and EntityRenderer::drawResources().
Here is the caller graph for this function:
|
static |
Returns a slime palette with variations based on the team color.
| teamColor | The base color of the team. |
Definition at line 32 of file ColorPalette.cpp.
References _slimePalettes, _teamColors, colorEquals(), KEEP, and PALETTE_SIZE.
Referenced by EntityRenderer::drawPlayer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns a unique color for a team based on its index. Will repeat if more teams than palette size.
| index | Index of the team (0-based). |
Definition at line 30 of file ColorPalette.cpp.
References _teamColors, and PALETTE_SIZE.
Referenced by RaylibRenderer::_initTeamColors().
Here is the caller graph for this function:
|
staticprivate |
Definition at line 7 of file ColorPalette.hpp.
Referenced by getSlimePalette().
|
staticprivate |
Definition at line 3 of file ColorPalette.hpp.
Referenced by getSlimePalette(), and getTeamColor().
|
staticconstexpr |
Sentinel: do not modify this material slot.
Definition at line 17 of file ColorPalette.hpp.
Referenced by EntityRenderer::drawPlayer(), and getSlimePalette().
|
staticconstexpr |
Definition at line 47 of file ColorPalette.hpp.
Referenced by getSlimePalette(), and getTeamColor().