Freeciv-3.2
Loading...
Searching...
No Matches
Functions
colors.c File Reference
#include <SDL3/SDL.h>
#include "rgbcolor.h"
#include "tilespec.h"
#include "themespec.h"
#include "colors.h"

Go to the source code of this file.

Functions

SDL_Colorget_theme_color (enum theme_color themecolor)
 
SDL_Colorget_game_color (enum color_std stdcolor)
 
struct colorcolor_alloc_rgba (int r, int g, int b, int a)
 
struct colorcolor_alloc (int r, int g, int b)
 
void color_free (struct color *pcolor)
 
int color_brightness_score (struct color *pcolor)
 

Function Documentation

◆ color_alloc()

struct color * color_alloc ( int  r,
int  g,
int  b 
)

Allocate a solid color and return a pointer to it.

Definition at line 78 of file colors.c.

◆ color_alloc_rgba()

struct color * color_alloc_rgba ( int  r,
int  g,
int  b,
int  a 
)

Allocate a color with alpha channel and return a pointer to it. Alpha channel is not really used yet.

Definition at line 60 of file colors.c.

◆ color_brightness_score()

int color_brightness_score ( struct color pcolor)

Return a number indicating the perceptual brightness of this color relative to others (larger is brighter).

Definition at line 113 of file colors.c.

◆ color_free()

void color_free ( struct color pcolor)

Free resources allocated for color.

Definition at line 96 of file colors.c.

◆ get_game_color()

SDL_Color * get_game_color ( enum color_std  stdcolor)

Get color for some game object instance.

Definition at line 51 of file colors.c.

◆ get_theme_color()

SDL_Color * get_theme_color ( enum theme_color  themecolor)

Get color from theme.

Definition at line 43 of file colors.c.