10 #ifndef PALETTE_FUNC_H
11 #define PALETTE_FUNC_H
21 void GfxInitPalettes();
38 return colours < COLOUR_END;
43 enum ColourShade : uint8_t {
45 SHADE_DARKEST = SHADE_BEGIN,
58 void SetColourGradient(Colours colour, ColourShade shade, uint8_t palette_colour);
65 #define GREY_SCALE(level) (level)
Type (helpers) for enums.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Types related to the graphics and/or input devices.
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
static const uint8_t PC_VERY_DARK_RED
Almost-black red palette colour.
static const uint8_t PC_LIGHT_YELLOW
Light yellow palette colour.
static const uint8_t PC_TREES
Green palette colour for trees.
static const uint8_t PC_GREY
Grey palette colour.
static const uint8_t PC_GREEN
Green palette colour.
static const uint8_t PC_WHITE
White palette colour.
bool CopyPalette(Palette &local_palette, bool force_copy=false)
Copy the current palette if the palette was updated.
static const uint8_t PC_DARK_GREY
Dark grey palette colour.
static const uint8_t PC_WATER
Dark blue palette colour for water.
static const uint8_t PC_LIGHT_BLUE
Light blue palette colour.
uint8_t GetColourGradient(Colours colour, ColourShade shade)
Get colour gradient palette index.
static const uint8_t PC_FIELDS
Light brown palette colour for fields.
bool IsValidColours(Colours colours)
Checks if a Colours value is valid.
static const uint8_t PC_DARK_BLUE
Dark blue palette colour.
static const uint8_t PC_BLACK
Black palette colour.
static const uint8_t PC_DARK_RED
Dark red palette colour.
static const uint8_t PC_ROUGH_LAND
Dark green palette colour for rough land.
Palette _cur_palette
Current palette.
static const uint8_t PC_BARE_LAND
Brown palette colour for bare land.
static const uint8_t PC_ORANGE
Orange palette colour.
static const uint8_t PC_RED
Red palette colour.
static const uint8_t PC_VERY_DARK_BLUE
Almost-black blue palette colour.
TextColour GetContrastColour(uint8_t background, uint8_t threshold=128)
Determine a contrasty text colour for a coloured background.
static const uint8_t PC_VERY_DARK_BROWN
Almost-black brown palette colour.
uint8_t GetNearestColourIndex(uint8_t r, uint8_t g, uint8_t b)
Get nearest colour palette index from an RGB colour.
static const uint8_t PC_YELLOW
Yellow palette colour.
static const uint8_t PC_GRASS_LAND
Dark green palette colour for grass land.
void SetColourGradient(Colours colour, ColourShade shade, uint8_t palette_colour)
Set colour gradient palette index.
static const uint8_t PC_RAINFOREST
Pale green palette colour for rainforest.
#define GREY_SCALE(level)
Return the colour for a particular greyscale level.
static const uint8_t PC_VERY_LIGHT_YELLOW
Almost-white yellow palette colour.
Types related to strings.
Information about the currently used palette.
Structure to access the alpha, red, green, and blue channels from a 32 bit number.