commit 09d9909623cb80922182112815a11837823d1390 parent 7d8152498f3823de733d706f6ab71ed4ec44f1cc Author: William Casarin <jb55@jb55.com> Date: Mon, 20 Aug 2018 23:57:37 -0700 random colors for now Diffstat:
M | viscal.c | | | 15 | ++++++++++----- |
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/viscal.c b/viscal.c @@ -1003,11 +1003,16 @@ int main(int argc, char *argv[]) ical = calendar_load_ical(&cal, argv[i]); // TODO: configure colors from cli? - ical->color = defcol; - ical->color.r = rand_0to1(); - ical->color.g = rand_0to1(); - ical->color.b = rand_0to1(); - ical->color.a = 1.0; + if (ical != NULL) { + ical->color = defcol; + ical->color.r = rand_0to1(); + ical->color.g = rand_0to1(); + ical->color.b = rand_0to1(); + ical->color.a = 1.0; + } + else { + printf("failed to load calendar\n"); + } } on_change_view(&cal);