|
Player12
An open source football management simulator
|
#include "gui/render/match_kit_colors.h"#include <algorithm>#include <array>#include <cmath>#include <cstddef>#include <initializer_list>#include <optional>#include <unordered_map>#include "database/datagenerator.h"Functions | |
| const ClubIdentity * | findClubIdentity (TeamID team) |
| float | kitColorDistance (ImU32 first, ImU32 second) |
| ImU32 | kitNumberColor (const KitColors &kit) |
| ImU32 | goalkeeperGloveColor (const KitColors &kit) |
| MatchKits | chooseMatchKits (TeamID homeTeam, TeamID awayTeam) |
| MatchKits | chooseMatchKits (TeamID homeTeam, TeamID awayTeam, const ClubColours *homeColours, const ClubColours *awayColours) |
Picks the strips of a match. Clubs with colours in the data pack wear them (primary shirt, secondary trim and shorts); others get a deterministic original strip from their id. The away side switches to its reversed colours, then to a change strip, when its shirt is too close to the home shirt, and both goalkeepers wear colours distinct from every outfield shirt and from each other. Every view (2D, 3D, HUD swatches) uses this so a club always looks the same.
| MatchKits chooseMatchKits | ( | TeamID | homeTeam, |
| TeamID | awayTeam, | ||
| const ClubColours * | homeColours, | ||
| const ClubColours * | awayColours | ||
| ) |
Same, with explicit club colours (null: the hashed original strip).
| const ClubIdentity * findClubIdentity | ( | TeamID | team | ) |
The club's data-pack identity (short name, colours, stadium), read once per process and cached; null for clubs the pack does not describe.
| ImU32 goalkeeperGloveColor | ( | const KitColors & | kit | ) |
Goalkeeper gloves: the stock colour that stands out most on the shirt.
| float kitColorDistance | ( | ImU32 | first, |
| ImU32 | second | ||
| ) |
Perceptual ("redmean") RGB distance between two packed colours.
| ImU32 kitNumberColor | ( | const KitColors & | kit | ) |
Colour of the numbers and names printed on a shirt: the trim when it contrasts with the shirt, otherwise white or near-black, whichever stands out more.