]>
Dogcows Code - chaz/homebank/blob - src/gtk-chart-colors.c
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2016 Maxime DOYEN
4 * This file is part of HomeBank.
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * HomeBank is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "gtk-chart-colors.h"
24 char *chart_colors
[] =
37 struct rgbcol money_colors
[] =
67 int money_nbcolors
= G_N_ELEMENTS(money_colors
);
70 struct rgbcol quicken_colors
[] =
83 { 113, 113, 113 }, // others
85 int quicken_nbcolors
= G_N_ELEMENTS(quicken_colors
);
88 struct rgbcol analytics_colors
[] =
90 { 5, 141, 199 }, //line color
101 { 204, 204, 204 }, // others
103 int analytics_nbcolors
= G_N_ELEMENTS(analytics_colors
);
106 struct rgbcol office2010_colors
[] =
129 int office2010_nbcolors
= G_N_ELEMENTS(office2010_colors
);
132 struct rgbcol office2013_colors
[] =
155 int office2013_nbcolors
= G_N_ELEMENTS(office2013_colors
);
157 struct rgbcol sap_colors
[] =
195 int sap_nbcolors
= G_N_ELEMENTS(sap_colors
);
197 struct rgbcol homebank_colors
[] =
234 int homebank_nbcolors
= G_N_ELEMENTS(homebank_colors
);
238 struct rgbcol global_colors
[] =
241 {255, 255, 255}, // white
242 {239, 239, 239}, // grey1 THTEXT 0.05
243 { 68, 68, 68}, // text THTEXT 0.78
244 { 51, 51, 51}, // xyline THTEXT 0.8
247 /* { 255, 0, 0}, // fake
248 { 255, 255, 0}, // fake
249 { 255, 0, 255}, // fake
250 { 0, 255, 0}, // fake
251 { 0, 0, 255}, // fake
255 {255, 255, 255}, // theme base (bg)
256 { 46, 52, 54}, // theme fg
262 struct rgbcol global_colors[] =
265 {255, 255, 255}, // white
266 {238, 238, 238}, // #top/bottom lines
267 {204, 204, 204}, // #dotted lines
268 {102, 102, 102}, // #x-axis, scale text
269 {153, 153, 153}, // # ??
270 { 0, 119, 204}, // #line color
273 {239, 239, 239}, // intermediate lines
274 { 68, 68, 68}, // text
275 { 51, 51, 51}, // x/y axis
281 void chart_color_global_default(void)
285 // set base color (adwaita)
286 tcol
= &global_colors
[THBASE
];
291 // set text(bg) color (adwaita)
292 tcol
= &global_colors
[THTEXT
];
299 void cairo_user_set_rgbcol(cairo_t
*cr
, struct rgbcol
*col
)
301 cairo_set_source_rgb(cr
, COLTOCAIRO(col
->r
), COLTOCAIRO(col
->g
), COLTOCAIRO(col
->b
));
305 void cairo_user_set_rgbacol(cairo_t
*cr
, struct rgbcol
*col
, double alpha
)
307 cairo_set_source_rgba(cr
, COLTOCAIRO(col
->r
), COLTOCAIRO(col
->g
), COLTOCAIRO(col
->b
), alpha
);
311 void cairo_user_set_rgbcol_over(cairo_t
*cr
, struct rgbcol
*col
, gboolean over
)
314 cairo_set_source_rgb(cr
, COLTOCAIROOVER(col
->r
), COLTOCAIROOVER(col
->g
), COLTOCAIROOVER(col
->b
));
316 cairo_set_source_rgb(cr
, COLTOCAIRO(col
->r
), COLTOCAIRO(col
->g
), COLTOCAIRO(col
->b
));
320 void colorscheme_init(GtkColorScheme
*scheme
, gint index
)
328 case CHART_COLMAP_HOMEBANK
:
329 scheme
->colors
= homebank_colors
;
330 scheme
->nb_cols
= homebank_nbcolors
;
331 scheme
->cs_green
= 4;
333 scheme
->cs_yellow
= 2;
334 scheme
->cs_orange
= 2;
336 case CHART_COLMAP_MSMONEY
:
337 scheme
->colors
= money_colors
;
338 scheme
->nb_cols
= money_nbcolors
;
339 scheme
->cs_blue
= 17;
340 scheme
->cs_green
= 19;
342 scheme
->cs_yellow
= 16;
343 scheme
->cs_orange
= 8;
345 case CHART_COLMAP_QUICKEN
:
346 scheme
->colors
= quicken_colors
;
347 scheme
->nb_cols
= quicken_nbcolors
;
349 scheme
->cs_green
= 2;
351 scheme
->cs_yellow
= 1;
352 scheme
->cs_orange
= 9;
354 case CHART_COLMAP_ANALYTICS
:
355 scheme
->colors
= analytics_colors
;
356 scheme
->nb_cols
= analytics_nbcolors
;
357 scheme
->cs_green
= 1;
359 scheme
->cs_yellow
= 3;
360 scheme
->cs_orange
= 6;
362 case CHART_COLMAP_OFFICE2010
:
363 scheme
->colors
= office2010_colors
;
364 scheme
->nb_cols
= office2010_nbcolors
;
365 scheme
->cs_green
= 2;
367 scheme
->cs_yellow
= 5;
368 scheme
->cs_orange
= 5;
370 case CHART_COLMAP_OFFICE2013
:
371 scheme
->colors
= office2013_colors
;
372 scheme
->nb_cols
= office2013_nbcolors
;
373 scheme
->cs_green
= 5;
375 scheme
->cs_yellow
= 3;
376 scheme
->cs_orange
= 1;
378 case CHART_COLMAP_SAP
:
379 scheme
->colors
= sap_colors
;
380 scheme
->nb_cols
= sap_nbcolors
;
381 scheme
->cs_green
= 14;
383 scheme
->cs_yellow
= 12;
384 scheme
->cs_orange
= 20;
This page took 0.059049 seconds and 4 git commands to generate.