Freeciv-3.2
Loading...
Searching...
No Matches
colors.cpp
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18// utility
19#include "mem.h"
20
21// common
22#include "rgbcolor.h"
23
24// gui-qt
25#include "qtg_cxxside.h"
26
27#include "colors.h"
28
29/************************************************************************/
33struct color *qtg_color_alloc(int r, int g, int b)
34{
35 struct color *pcolor = new color;
36
37 pcolor->qcolor.setRgb(r, g, b);
38
39 return pcolor;
40}
41
42/************************************************************************/
46{
47 delete pcolor;
48}
49
50/************************************************************************/
55{
56 /* QColor has color space conversions, but nothing giving a perceptually
57 * even color space */
58 struct rgbcolor *prgb = rgbcolor_new(pcolor->qcolor.red(),
59 pcolor->qcolor.green(),
60 pcolor->qcolor.blue());
62
64 return score;
65}
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
Definition canvas_g.h:56
struct color * qtg_color_alloc(int r, int g, int b)
Definition colors.cpp:33
int color_brightness_score(struct color *pcolor)
Definition colors.cpp:54
void qtg_color_free(struct color *pcolor)
Definition colors.cpp:45
char * incite_cost
Definition comments.c:74
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
Definition rgbcolor.c:74
struct rgbcolor * rgbcolor_new(int r, int g, int b)
Definition rgbcolor.c:34
int rgbcolor_brightness_score(struct rgbcolor *prgbcolor)
Definition rgbcolor.c:196
Definition colors.h:21
int g
Definition colors.h:21
GdkRGBA color
Definition colors.h:22
int r
Definition colors.h:21
int b
Definition colors.h:21