mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
🦞
This commit is contained in:
parent
4c7bf9706f
commit
d19a33501a
36 changed files with 808 additions and 1052 deletions
|
@ -3,7 +3,7 @@ OnlyLegs filters
|
|||
Custom Jinja2 filters
|
||||
"""
|
||||
from flask import Blueprint
|
||||
from onlylegs.utils.colour import contrast
|
||||
from onlylegs.utils import colour as colour_utils
|
||||
|
||||
|
||||
blueprint = Blueprint("filters", __name__)
|
||||
|
@ -16,7 +16,5 @@ def colour_contrast(colour):
|
|||
a css variable based on the contrast of text required to be readable
|
||||
"color: var(--fg-white);" or "color: var(--fg-black);"
|
||||
"""
|
||||
bright = "var(--fg-white)"
|
||||
dark = "var(--fg-black)"
|
||||
|
||||
return "color: RGB(" + contrast(colour, dark, bright) + ");"
|
||||
colour_obj = colour_utils.Colour(colour)
|
||||
return "rgb(var(--fg-black));" if colour_obj.is_light() else "rgb(var(--fg-white));"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue