![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "log.h"#include "shared.h"#include "player.h"#include "rgbcolor.h"#include "terrain.h"#include "colors_g.h"#include "tileset/tilespec.h"#include "colors_common.h"
Include dependency graph for colors_common.cpp:Go to the source code of this file.
Classes | |
| struct | color_system |
Functions | |
| struct color_system * | color_system_read (struct section_file *file) |
| Called when the client first starts to allocate the default colors. More... | |
| void | color_system_free (struct color_system *colors) |
| Called when the client first starts to free any allocated colors. More... | |
| QColor | get_color (const struct tileset *t, enum color_std stdcolor) |
| Return a pointer to the given "standard" color. More... | |
| bool | player_has_color (const struct tileset *t, const struct player *pplayer) |
| Return whether the player has a color assigned yet. More... | |
| QColor | get_player_color (const struct tileset *t, const struct player *pplayer) |
| Return the color of the player. More... | |
| QColor | get_terrain_color (const struct tileset *t, const struct terrain *pterrain) |
| Return a pointer to the given "terrain" color. More... | |
| QColor | color_best_contrast (const QColor &subject, const QColor *candidates, int ncandidates) |
| Find the colour from 'candidates' with the best perceptual contrast from 'subject'. More... | |
| int | color_brightness_score (const QColor &color) |
| Return a number indicating the perceptual brightness of this color relative to others (larger is brighter). More... | |
| QColor color_best_contrast | ( | const QColor & | subject, |
| const QColor * | candidates, | ||
| int | ncandidates | ||
| ) |
Find the colour from 'candidates' with the best perceptual contrast from 'subject'.
Definition at line 136 of file colors_common.cpp.
Referenced by diplo_wdg::diplo_wdg(), traditional_citybar_painter::paint(), and polished_citybar_painter::paint().
| int color_brightness_score | ( | const QColor & | color | ) |
Return a number indicating the perceptual brightness of this color relative to others (larger is brighter).
Definition at line 162 of file colors_common.cpp.
Referenced by color_best_contrast().
| void color_system_free | ( | struct color_system * | colors | ) |
Called when the client first starts to free any allocated colors.
Definition at line 66 of file colors_common.cpp.
Referenced by tileset_free_toplevel().
| struct color_system* color_system_read | ( | struct section_file * | file | ) |
Called when the client first starts to allocate the default colors.
Currently this must be called in ui_main, generally after UI initialization.
Definition at line 40 of file colors_common.cpp.
Referenced by tileset_read_toplevel().
| QColor get_color | ( | const struct tileset * | t, |
| enum color_std | stdcolor | ||
| ) |
Return a pointer to the given "standard" color.
Definition at line 82 of file colors_common.cpp.
Referenced by apply_tags(), calculate_overview_dimensions(), diplo_wdg::diplo_wdg(), draw_calculated_trade_routes(), draw_reqtree(), draw_segment(), draw_trade_route_line(), get_diag_color(), link_mark_color(), map_canvas_resized(), overview_tile_color(), simple_citybar_painter::paint(), traditional_citybar_painter::paint(), polished_citybar_painter::paint(), redraw_overview(), show_tile_label(), and update_map_canvas().
Return the color of the player.
In pregame, callers should check player_has_color() before calling this.
Definition at line 109 of file colors_common.cpp.
Referenced by plr_item::data(), diplo_wdg::diplo_wdg(), freeciv::layer_background::initialize_player(), freeciv::layer_grid::initialize_player(), overview_tile_color(), traditional_citybar_painter::paint(), polished_citybar_painter::paint(), and page_pregame::update_start_page().
Return a pointer to the given "terrain" color.
Definition at line 122 of file colors_common.cpp.
Referenced by overview_tile_color().
Return whether the player has a color assigned yet.
Should only be FALSE in pregame.
Definition at line 96 of file colors_common.cpp.
Referenced by freeciv::layer_background::initialize_player(), freeciv::layer_grid::initialize_player(), and page_pregame::update_start_page().