This commit is contained in:
Kovid Goyal 2020-08-05 09:23:14 +05:30
parent 75a14bad36
commit 9283e58359
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from elementmaker import E
from gettext import gettext as _ from gettext import gettext as _
from book_list.globals import get_session_data from book_list.globals import get_session_data
from book_list.theme import cached_color_to_rgba
from dom import ( from dom import (
add_extra_css, build_rule, clear, set_css, set_radio_group_value, svgicon, add_extra_css, build_rule, clear, set_css, set_radio_group_value, svgicon,
unique_id unique_id
@ -54,6 +55,8 @@ def resolve_color_scheme(current_color_scheme):
for sn in default_color_schemes: for sn in default_color_schemes:
ans = default_color_schemes[sn] ans = default_color_schemes[sn]
break break
rgba = cached_color_to_rgba(ans.background)
ans.is_dark_theme = max(rgba[0], rgba[1], rgba[2]) < 115
return ans return ans
def change_current_color(ev): def change_current_color(ev):

View File

@ -752,8 +752,6 @@ class View:
# so we dont want the body background color to bleed through # so we dont want the body background color to bleed through
iframe.parentNode.style.backgroundColor = ans.background iframe.parentNode.style.backgroundColor = ans.background
iframe.parentNode.parentNode.style.backgroundColor = ans.background iframe.parentNode.parentNode.style.backgroundColor = ans.background
rgba = cached_color_to_rgba(ans.background)
ans.is_dark_theme = max(rgba[0], rgba[1], rgba[2]) < 115
return ans return ans
def on_resize(self): def on_resize(self):