[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/src/gtk gtk_eb_html.c,1.3,1.4
From: |
Philip S Tellis <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/src/gtk gtk_eb_html.c,1.3,1.4 |
Date: |
Thu, 30 Jan 2003 09:41:49 -0500 |
Update of /cvsroot/ayttm/ayttm/src/gtk
In directory subversions:/tmp/cvs-serv5805/src/gtk
Modified Files:
gtk_eb_html.c
Log Message:
this time really fixed the colours
Index: gtk_eb_html.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/gtk/gtk_eb_html.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gtk_eb_html.c 30 Jan 2003 12:02:31 -0000 1.3
+++ gtk_eb_html.c 30 Jan 2003 14:41:47 -0000 1.4
@@ -407,26 +407,34 @@
}
-static const int colour_threshold = 0x60;
+static const int dark_threshold = 0xd0;
+static const int lighten_delta = 0x38;
+static const int darken_delta = 0x60;
static int _lighten(int colour)
{
- if(colour + colour_threshold < 0xff)
- return colour + colour_threshold;
+ if(!colour)
+ return 0;
+ if(colour + lighten_delta < 0xff)
+ return colour + lighten_delta;
else
return 0xff;
}
static int _darken(int colour)
{
- if(colour - colour_threshold > 0)
- return colour - colour_threshold;
+ if(!colour)
+ return 0;
+ if(colour - darken_delta > 0)
+ return colour - darken_delta;
else
return 0;
}
static int _is_dark(int r, int g, int b)
{
- return (r + g + b < 3 * colour_threshold);
+ return (r <= dark_threshold &&
+ g <= dark_threshold &&
+ b <= dark_threshold);
}
static void _adjust_colors(int*fg_r, int*fg_g, int*fg_b,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/src/gtk gtk_eb_html.c,1.3,1.4,
Philip S Tellis <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.24,1.25
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.258,1.259 configure.in,1.254,1.255
- Previous by thread:
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.24,1.25
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.258,1.259 configure.in,1.254,1.255
- Index(es):