mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
75a14bad36
commit
9283e58359
@ -6,6 +6,7 @@ from elementmaker import E
|
||||
from gettext import gettext as _
|
||||
|
||||
from book_list.globals import get_session_data
|
||||
from book_list.theme import cached_color_to_rgba
|
||||
from dom import (
|
||||
add_extra_css, build_rule, clear, set_css, set_radio_group_value, svgicon,
|
||||
unique_id
|
||||
@ -54,6 +55,8 @@ def resolve_color_scheme(current_color_scheme):
|
||||
for sn in default_color_schemes:
|
||||
ans = default_color_schemes[sn]
|
||||
break
|
||||
rgba = cached_color_to_rgba(ans.background)
|
||||
ans.is_dark_theme = max(rgba[0], rgba[1], rgba[2]) < 115
|
||||
return ans
|
||||
|
||||
def change_current_color(ev):
|
||||
|
@ -752,8 +752,6 @@ class View:
|
||||
# so we dont want the body background color to bleed through
|
||||
iframe.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
|
||||
|
||||
def on_resize(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user