diff --git a/smash/web/api_views/daily_planning.py b/smash/web/api_views/daily_planning.py index 5086686b96a7ff5d8cb78f8b9d0ba002e75e685f..f526803cd4873b114e3a7a09a50a93e3b29a601a 100644 --- a/smash/web/api_views/daily_planning.py +++ b/smash/web/api_views/daily_planning.py @@ -1,7 +1,5 @@ import datetime import json -import random - from operator import itemgetter from django.contrib.auth.decorators import login_required @@ -11,16 +9,27 @@ from django.shortcuts import get_object_or_404 from ..models import Appointment, AppointmentTypeLink, Worker, Availability, Holiday from ..views.notifications import get_filter_locations -# mix_color = (0, 166, 90) -mix_color = (155, 155, 155) - - -def get_random_color(): - r = lambda: random.randint(0, 255) - return '#%02X%02X%02X' % ((r() + mix_color[0]) / 2, (r() + mix_color[1]) / 2, (r() + mix_color[2]) / 2) - - -RANDOM_COLORS = [get_random_color() for i in range(20)] +RANDOM_COLORS = [ + '#%02X%02X%02X' % (8, 218, 217), + '#%02X%02X%02X' % (8, 8, 101), + '#%02X%02X%02X' % (8, 218, 3), + '#%02X%02X%02X' % (247, 137, 156), + '#%02X%02X%02X' % (183, 96, 2), + '#%02X%02X%02X' % (20, 106, 55), + '#%02X%02X%02X' % (8, 119, 217), + '#%02X%02X%02X' % (16, 76, 27), + '#%02X%02X%02X' % (85, 7, 162), + '#%02X%02X%02X' % (157, 7, 2), + '#%02X%02X%02X' % (49, 65, 68), + '#%02X%02X%02X' % (112, 124, 98), + '#%02X%02X%02X' % (8, 8, 215), + '#%02X%02X%02X' % (85, 7, 98), + '#%02X%02X%02X' % (16, 76, 100), + '#%02X%02X%02X' % (85, 7, 50), + '#%02X%02X%02X' % (183, 5, 2), + '#%02X%02X%02X' % (183, 156, 2), + '#%02X%02X%02X' % (112, 82, 38), +] def build_duration(duration):