use variables for background colors
This commit is contained in:
parent
770c000a93
commit
40b2e06c83
3 changed files with 34 additions and 6 deletions
|
|
@ -37,13 +37,34 @@ class Film(models.Model):
|
|||
def duration(self):
|
||||
return ox.format_timecode(self.data['duration'])[:-4]
|
||||
|
||||
def color(self):
|
||||
def color_1(self):
|
||||
hue = self.data['hue']
|
||||
saturation = self.data['saturation'] * 100
|
||||
saturation = 70
|
||||
lightness = self.data['lightness'] * 100
|
||||
return "hsl({}, {}%, {}%)".format(hue, saturation, lightness)
|
||||
|
||||
def color_2(self):
|
||||
hue = self.data['hue']
|
||||
saturation = self.data['saturation'] * 100
|
||||
saturation = 70
|
||||
lightness = self.data['lightness'] * 50
|
||||
return "hsl({}, {}%, {}%)".format(hue, saturation, lightness)
|
||||
|
||||
def color_3(self):
|
||||
hue = self.data['hue']
|
||||
saturation = self.data['saturation'] * 100
|
||||
saturation = 70
|
||||
lightness = self.data['lightness'] * 110
|
||||
return "hsl({}, {}%, {}%)".format(hue, saturation, lightness)
|
||||
|
||||
def color_4(self):
|
||||
hue = self.data['hue']
|
||||
saturation = self.data['saturation'] * 100
|
||||
saturation = 70
|
||||
lightness = self.data['lightness'] * 80
|
||||
return "hsl({}, {}%, {}%)".format(hue, saturation, lightness)
|
||||
|
||||
def json(self):
|
||||
data = {}
|
||||
data['id'] = self.padma_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue