add hsl
This commit is contained in:
parent
c851bdca4d
commit
0530520cd2
2 changed files with 16 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue