From 0530520cd24ba2503afe247f30d5d9e17583f630 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 13 Oct 2021 16:35:47 +0100 Subject: [PATCH] add hsl --- app/templates/film.html | 9 +++++++++ app/video/models.py | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/app/templates/film.html b/app/templates/film.html index 7756643..0f4851f 100644 --- a/app/templates/film.html +++ b/app/templates/film.html @@ -1,5 +1,14 @@ {% extends "base.html" %} {% block main %} +
diff --git a/app/video/models.py b/app/video/models.py index 3de1ec5..12ca2bd 100644 --- a/app/video/models.py +++ b/app/video/models.py @@ -37,10 +37,17 @@ class Film(models.Model): def duration(self): return ox.format_timecode(self.data['duration'])[:-4] + def color(self): + hue = self.data['hue'] + saturation = self.data['saturation'] * 100 + saturation = 70 + lightness = self.data['lightness'] * 100 + return "hsl({}, {}%, {}%)".format(hue, saturation, lightness) def json(self): data = {} data['id'] = self.padma_id + #data.update(self.data) return json.dumps(data)