aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2004-05-07 12:35:36 +0800
committerLarry Ewing <lewing@src.gnome.org>2004-05-07 12:35:36 +0800
commit13dfba8729e2105f6a9e8f3d01e6c21d30cfb13f (patch)
tree4ddc09154c520005151150a0c6066fb60ae1e7f9 /calendar/gui
parente7693afcaf315627b528c61a67ca040a73f23997 (diff)
downloadgsoc2013-evolution-13dfba8729e2105f6a9e8f3d01e6c21d30cfb13f.tar.gz
gsoc2013-evolution-13dfba8729e2105f6a9e8f3d01e6c21d30cfb13f.tar.zst
gsoc2013-evolution-13dfba8729e2105f6a9e8f3d01e6c21d30cfb13f.zip
use random color for calendar default.
2004-05-06 Larry Ewing <lewing@ximian.com> * gui/dialogs/calendar-setup.c (source_to_dialog): use random color for calendar default. svn path=/trunk/; revision=25818
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/calendar-setup.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c
index 47012cc88d..f97af53c56 100644
--- a/calendar/gui/dialogs/calendar-setup.c
+++ b/calendar/gui/dialogs/calendar-setup.c
@@ -532,7 +532,23 @@ source_to_dialog (SourceDialog *source_dialog)
g_signal_handlers_unblock_matched (source_dialog->refresh_spin, G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL, source_dialog);
if (source_dialog->source_color) {
- guint32 color = 0xff00ff00;
+ static char *assigned_colors[] = {
+ 0xBECEDD, /* 190 206 221 Blue */
+ 0xE2F0EF, /* 226 240 239 Light Blue */
+ 0xC6E2B7, /* 198 226 183 Green */
+ 0xE2F0D3, /* 226 240 211 Light Green */
+ 0xE2D4B7, /* 226 212 183 Khaki */
+ 0xEAEAC1, /* 234 234 193 Light Khaki */
+ 0xF0B8B7, /* 240 184 183 Pink */
+ 0xFED4D3, /* 254 212 211 Light Pink */
+ 0xE2C6E1, /* 226 198 225 Purple */
+ 0xF0E2EF /* 240 226 239 Light Purple */
+ };
+ GRand *rand = g_rand_new ();
+ guint32 color;
+
+ color = assigned_colors[g_rand_int_range (rand, 0, 9)];
+ g_rand_free (rand);
if (source_dialog->source)
e_source_get_color (source_dialog->source, &color);