![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <cstdarg>#include "log.h"#include "registry.h"#include "registry_ini.h"#include "rgbcolor.h"
Include dependency graph for rgbcolor.cpp:Go to the source code of this file.
Functions | |
| struct rgbcolor * | rgbcolor_new (int r, int g, int b) |
| Allocate new rgbcolor structure. More... | |
| struct rgbcolor * | rgbcolor_copy (const struct rgbcolor *prgbcolor) |
| Allocate new rgbcolor structure and make it copy of one given as input. More... | |
| bool | rgbcolors_are_equal (const struct rgbcolor *c1, const struct rgbcolor *c2) |
| Test whether two rgbcolor structures represent the exact same color value. More... | |
| void | rgbcolor_destroy (struct rgbcolor *prgbcolor) |
| Free rgbcolor structure. More... | |
| bool | rgbcolor_load (struct section_file *file, struct rgbcolor **prgbcolor, const char *path,...) |
Lookup an RGB color definition ([colorpath].red, [colorpath].green and [colorpath].blue). More... | |
| void | rgbcolor_save (struct section_file *file, const struct rgbcolor *prgbcolor, const char *path,...) |
Save an RGB color definition ([colorpath].red, [colorpath].green and [colorpath].blue). More... | |
| bool | rgbcolor_to_hex (const struct rgbcolor *prgbcolor, char *hex, size_t hex_len) |
| Convert a rgb color to a hex string (like 0xff0000 for red [255, 0, 0]). More... | |
| bool | rgbcolor_from_hex (struct rgbcolor **prgbcolor, const char *hex) |
| Convert a hex string into a rgb color. More... | |
| int | rgbcolor_brightness_score (struct rgbcolor *prgbcolor) |
| Return a number indicating the perceptual brightness of this color relative to others (larger is brighter). More... | |
| int rgbcolor_brightness_score | ( | struct rgbcolor * | prgbcolor | ) |
Return a number indicating the perceptual brightness of this color relative to others (larger is brighter).
Definition at line 185 of file rgbcolor.cpp.
Referenced by color_brightness_score().
Allocate new rgbcolor structure and make it copy of one given as input.
Return new one.
Definition at line 41 of file rgbcolor.cpp.
Referenced by player_set_color().
| void rgbcolor_destroy | ( | struct rgbcolor * | prgbcolor | ) |
Free rgbcolor structure.
Definition at line 65 of file rgbcolor.cpp.
Referenced by color_system_free(), game_ruleset_free(), handle_player_info(), player_destroy(), player_set_color(), playercolor_command(), playercolor_free(), server_player_set_color(), sg_load_players_basic(), terrains_free(), and nation_type::~nation_type().
| bool rgbcolor_from_hex | ( | struct rgbcolor ** | prgbcolor, |
| const char * | hex | ||
| ) |
Convert a hex string into a rgb color.
Definition at line 151 of file rgbcolor.cpp.
Referenced by playercolor_command().
| bool rgbcolor_load | ( | struct section_file * | file, |
| struct rgbcolor ** | prgbcolor, | ||
| const char * | path, | ||
| ... | |||
| ) |
Lookup an RGB color definition ([colorpath].red, [colorpath].green and [colorpath].blue).
Returns TRUE on success and FALSE on error.
Definition at line 78 of file rgbcolor.cpp.
Referenced by color_system_read(), load_ruleset_game(), load_ruleset_nations(), load_ruleset_terrain(), and sg_load_players_basic().
| struct rgbcolor* rgbcolor_new | ( | int | r, |
| int | g, | ||
| int | b | ||
| ) |
Allocate new rgbcolor structure.
Definition at line 25 of file rgbcolor.cpp.
Referenced by color_system_read(), handle_player_info(), handle_ruleset_game(), handle_ruleset_terrain(), rgbcolor_copy(), rgbcolor_from_hex(), and rgbcolor_load().
| void rgbcolor_save | ( | struct section_file * | file, |
| const struct rgbcolor * | prgbcolor, | ||
| const char * | path, | ||
| ... | |||
| ) |
Save an RGB color definition ([colorpath].red, [colorpath].green and [colorpath].blue).
Definition at line 109 of file rgbcolor.cpp.
Referenced by save_game_ruleset(), save_nation(), save_terrain_ruleset(), and sg_save_player_main().
| bool rgbcolor_to_hex | ( | const struct rgbcolor * | prgbcolor, |
| char * | hex, | ||
| size_t | hex_len | ||
| ) |
Convert a rgb color to a hex string (like 0xff0000 for red [255, 0, 0]).
Definition at line 130 of file rgbcolor.cpp.
Referenced by player_color_ftstr().
Test whether two rgbcolor structures represent the exact same color value.
(Does not attempt to determine whether they are visually distinguishable.)
Definition at line 52 of file rgbcolor.cpp.
Referenced by assign_player_colors(), and playercolor_command().