]>
Dogcows Code - chaz/homebank/blob - src/gtk-chart-colors.c
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2018 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
[] =
38 struct rgbcol ynab_colors
[] =
49 //{ 246, 166, 209 }, // added color
50 { 131, 131, 131 }, // others
52 int ynab_nbcolors
= G_N_ELEMENTS(ynab_colors
);
55 struct rgbcol money_colors
[] =
85 int money_nbcolors
= G_N_ELEMENTS(money_colors
);
88 struct rgbcol quicken_colors
[] =
101 { 113, 113, 113 }, // others
103 int quicken_nbcolors
= G_N_ELEMENTS(quicken_colors
);
106 struct rgbcol analytics_colors
[] =
108 { 5, 141, 199 }, //line color
119 { 204, 204, 204 }, // others
121 int analytics_nbcolors
= G_N_ELEMENTS(analytics_colors
);
124 struct rgbcol office2010_colors
[] =
147 int office2010_nbcolors
= G_N_ELEMENTS(office2010_colors
);
150 struct rgbcol office2013_colors
[] =
173 int office2013_nbcolors
= G_N_ELEMENTS(office2013_colors
);
175 struct rgbcol sap_colors
[] =
213 int sap_nbcolors
= G_N_ELEMENTS(sap_colors
);
215 struct rgbcol homebank_colors
[] =
252 int homebank_nbcolors
= G_N_ELEMENTS(homebank_colors
);
256 struct rgbcol global_colors
[] =
259 {255, 255, 255}, // white
260 {239, 239, 239}, // grey1 THTEXT 0.05
261 { 68, 68, 68}, // text THTEXT 0.78
262 { 51, 51, 51}, // xyline THTEXT 0.8
265 /* { 255, 0, 0}, // fake
266 { 255, 255, 0}, // fake
267 { 255, 0, 255}, // fake
268 { 0, 255, 0}, // fake
269 { 0, 0, 255}, // fake
273 {255, 255, 255}, // theme base (bg)
274 { 46, 52, 54}, // theme fg
280 struct rgbcol global_colors[] =
283 {255, 255, 255}, // white
284 {238, 238, 238}, // #top/bottom lines
285 {204, 204, 204}, // #dotted lines
286 {102, 102, 102}, // #x-axis, scale text
287 {153, 153, 153}, // # ??
288 { 0, 119, 204}, // #line color
291 {239, 239, 239}, // intermediate lines
292 { 68, 68, 68}, // text
293 { 51, 51, 51}, // x/y axis
299 void chart_color_global_default(void)
303 // set base color (adwaita)
304 tcol
= &global_colors
[THBASE
];
309 // set text(bg) color (adwaita)
310 tcol
= &global_colors
[THTEXT
];
317 void cairo_user_set_rgbcol(cairo_t
*cr
, struct rgbcol
*col
)
319 cairo_set_source_rgb(cr
, COLTOCAIRO(col
->r
), COLTOCAIRO(col
->g
), COLTOCAIRO(col
->b
));
323 void cairo_user_set_rgbacol(cairo_t
*cr
, struct rgbcol
*col
, double alpha
)
325 cairo_set_source_rgba(cr
, COLTOCAIRO(col
->r
), COLTOCAIRO(col
->g
), COLTOCAIRO(col
->b
), alpha
);
329 void cairo_user_set_rgbcol_over(cairo_t
*cr
, struct rgbcol
*col
, gboolean over
)
332 cairo_set_source_rgb(cr
, COLTOCAIROOVER(col
->r
), COLTOCAIROOVER(col
->g
), COLTOCAIROOVER(col
->b
));
334 cairo_set_source_rgb(cr
, COLTOCAIRO(col
->r
), COLTOCAIRO(col
->g
), COLTOCAIRO(col
->b
));
338 void colorscheme_init(GtkColorScheme
*scheme
, gint index
)
346 case CHART_COLMAP_HOMEBANK
:
347 scheme
->colors
= homebank_colors
;
348 scheme
->nb_cols
= homebank_nbcolors
;
349 scheme
->cs_green
= 4;
351 scheme
->cs_yellow
= 2;
352 scheme
->cs_orange
= 2;
354 case CHART_COLMAP_MSMONEY
:
355 scheme
->colors
= money_colors
;
356 scheme
->nb_cols
= money_nbcolors
;
357 scheme
->cs_blue
= 17;
358 scheme
->cs_green
= 19;
360 scheme
->cs_yellow
= 16;
361 scheme
->cs_orange
= 8;
363 case CHART_COLMAP_QUICKEN
:
364 scheme
->colors
= quicken_colors
;
365 scheme
->nb_cols
= quicken_nbcolors
;
367 scheme
->cs_green
= 2;
369 scheme
->cs_yellow
= 1;
370 scheme
->cs_orange
= 9;
372 case CHART_COLMAP_ANALYTICS
:
373 scheme
->colors
= analytics_colors
;
374 scheme
->nb_cols
= analytics_nbcolors
;
375 scheme
->cs_green
= 1;
377 scheme
->cs_yellow
= 3;
378 scheme
->cs_orange
= 6;
380 case CHART_COLMAP_OFFICE2010
:
381 scheme
->colors
= office2010_colors
;
382 scheme
->nb_cols
= office2010_nbcolors
;
383 scheme
->cs_green
= 2;
385 scheme
->cs_yellow
= 5;
386 scheme
->cs_orange
= 5;
388 case CHART_COLMAP_OFFICE2013
:
389 scheme
->colors
= office2013_colors
;
390 scheme
->nb_cols
= office2013_nbcolors
;
391 scheme
->cs_green
= 5;
393 scheme
->cs_yellow
= 3;
394 scheme
->cs_orange
= 1;
396 case CHART_COLMAP_SAP
:
397 scheme
->colors
= sap_colors
;
398 scheme
->nb_cols
= sap_nbcolors
;
399 scheme
->cs_green
= 14;
401 scheme
->cs_yellow
= 12;
402 scheme
->cs_orange
= 20;
404 case CHART_COLMAP_YNAB
:
405 scheme
->colors
= ynab_colors
;
406 scheme
->nb_cols
= ynab_nbcolors
;
408 scheme
->cs_green
= 5;
410 scheme
->cs_orange
= 1;
This page took 0.054186 seconds and 4 git commands to generate.