From 13dfba8729e2105f6a9e8f3d01e6c21d30cfb13f Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 7 May 2004 04:35:36 +0000 Subject: use random color for calendar default. 2004-05-06 Larry Ewing * gui/dialogs/calendar-setup.c (source_to_dialog): use random color for calendar default. svn path=/trunk/; revision=25818 --- calendar/ChangeLog | 5 +++++ calendar/gui/dialogs/calendar-setup.c | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 869515a665..e07b78043b 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2004-05-06 Larry Ewing + + * gui/dialogs/calendar-setup.c (source_to_dialog): use random + color for calendar default. + 2004-05-05 JP Rosevear Fixes #58025 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); -- cgit