1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
/*
Copyright (C) 2008 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "styles.h"
XftColor *XftColors [NXFTCOLORS];
XftFont *XftFonts [NXFTFONTS];
X_button_style Bst0;
XftColor *blackorwhite (XftColor *C)
{
float v;
v = 0.23f * C->color.red + 0.70f * C->color.green + 0.07f * C->color.blue;
return (v > 25e3f) ? XftColors [C_BLACK] : XftColors [C_WHITE];
}
void styles_init (X_display *disp, X_resman *xrm)
{
XftColors [C_BLACK] = disp->alloc_xftcolor ("black", 0);
XftColors [C_WHITE] = disp->alloc_xftcolor ("white", 0);
XftColors [C_MAIN_BG] = disp->alloc_xftcolor (xrm->get (".color.main.bg", "black" ), 0);
XftColors [C_MAIN_FG] = disp->alloc_xftcolor (xrm->get (".color.main.fg", "white" ), 0);
XftColors [C_MAIN_LS] = disp->alloc_xftcolor (xrm->get (".color.main.ls", "gray70" ), 0);
XftColors [C_MAIN_DS] = disp->alloc_xftcolor (xrm->get (".color.main.ds", "gray30" ), 0);
XftFonts [F_BUTT] = disp->alloc_xftfont (xrm->get (".font.butt", "luxi:bold:pixelsize=9"));
Bst0.font = XftFonts [F_BUTT];
Bst0.type = X_button_style::PLAIN;
Bst0.color.bg[0] = disp->alloc_color ("#000000", 0);
Bst0.color.fg[0] = disp->alloc_xftcolor ("#8080ff", 0);
Bst0.color.bg[1] = disp->alloc_color ("#000000", 0);
Bst0.color.fg[1] = disp->alloc_xftcolor ("#40ff40", 0);
Bst0.color.bg[2] = disp->alloc_color ("#000000", 0);
Bst0.color.fg[2] = disp->alloc_xftcolor ("#ffff00", 0);
Bst0.color.bg[3] = disp->alloc_color ("#ff2000", 0);
Bst0.color.fg[3] = disp->alloc_xftcolor ("#ffffff", 0);
}
void styles_fini (X_display *disp)
{
}
|