aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-04-03 21:43:42 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-04-03 21:43:42 +0800
commitb2574922faf3d720b44ac606e9fe012c7c54812b (patch)
treee8ffe27cb543ccfa5f5ad89c7637301d9b882753 /mail/em-format-html-display.c
parent16068d9b4191ea142a9e75a50eb8d260ed2bb406 (diff)
downloadgsoc2013-evolution-b2574922faf3d720b44ac606e9fe012c7c54812b.tar.gz
gsoc2013-evolution-b2574922faf3d720b44ac606e9fe012c7c54812b.tar.zst
gsoc2013-evolution-b2574922faf3d720b44ac606e9fe012c7c54812b.zip
** Fix for bug #350308
2008-04-03 Milan Crha <mcrha@redhat.com> ** Fix for bug #350308 * em-format-html-display.c: (efhd_gtkhtml_realise): Make colors only darker, not lighter. Use black in case someone has too dark theme. svn path=/trunk/; revision=35316
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index fa0c4fe620..64dbae3377 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -243,41 +243,27 @@ efhd_gtkhtml_realise(GtkHTML *html, EMFormatHTMLDisplay *efhd)
if (style) {
int state = GTK_WIDGET_STATE(html);
gushort r, g, b;
-#define SCALE (238)
+#define DARKER(a,v) a = ((a) > (v)) ? ((a) - (v)) : 0
/* choose a suitably darker or lighter colour */
r = style->base[state].red >> 8;
g = style->base[state].green >> 8;
b = style->base[state].blue >> 8;
- if (r+b+g > 128*3) {
- r = (r*SCALE) >> 8;
- g = (g*SCALE) >> 8;
- b = (b*SCALE) >> 8;
- } else {
- r = 128 - ((SCALE * r) >> 9);
- g = 128 - ((SCALE * g) >> 9);
- b = 128 - ((SCALE * b) >> 9);
- }
+ DARKER (r, 18);
+ DARKER (g, 18);
+ DARKER (b, 18);
efhd->formathtml.body_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
-#undef SCALE
-#define SCALE (174)
/* choose a suitably darker or lighter colour */
r = style->base[state].red >> 8;
g = style->base[state].green >> 8;
b = style->base[state].blue >> 8;
- if (r+b+g > 128*3) {
- r = (r*SCALE) >> 8;
- g = (g*SCALE) >> 8;
- b = (b*SCALE) >> 8;
- } else {
- r = 128 - ((SCALE * r) >> 9);
- g = 128 - ((SCALE * g) >> 9);
- b = 128 - ((SCALE * b) >> 9);
- }
+ DARKER (r, 82);
+ DARKER (g, 82);
+ DARKER (b, 82);
efhd->formathtml.frame_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
@@ -292,8 +278,8 @@ efhd_gtkhtml_realise(GtkHTML *html, EMFormatHTMLDisplay *efhd)
b = style->text[state].blue >> 8;
efhd->formathtml.text_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
+#undef DARKER
}
-#undef SCALE
}
static void