|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Member
![]() Posts: 18
Karma: 10
Join Date: Nov 2023
Device: Kobo Elipsa 2E
|
Why does Calibre Viewer mangle graphics background colors depending on theme?
I have a sample epub which SVG images containing math. Sometimes they display correctly, and sometimes their background colors are mangled. It depends on the theme I choose in the viewer.
For example: It seems to depend on what the theme background is. What is this behaviour? The test file: test.epub |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,527
Karma: 29634066
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It doesnt mangle anything. A theme sets background colors, depending on what CSS is in your book, it can have background colors that conflict, override or are overridden by the theme background. You can use the override all colors in book setting for consistency, which will override every color defined in the books own CSS
|
|
|
|
|
|
#3 | |
|
Member
![]() Posts: 18
Karma: 10
Join Date: Nov 2023
Device: Kobo Elipsa 2E
|
Quote:
Create a theme with background #737373. Works. Change to background #727272. Mangled. Even the app UI changes in response. |
|
|
|
|
|
|
#4 |
|
Bibliophist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,263
Karma: 8582523
Join Date: Dec 2021
Location: England
Device: none
|
But doesn't the theme generally change the UI - that's surely what they do?
I don't think I clearly understand the issue.... As Kovid said |
|
|
|
|
|
#5 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,527
Karma: 29634066
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sorry I can see no mangling 72 and 73 look basically identical to me.
|
|
|
|
|
|
#6 |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,861
Karma: 34252730
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
|
|
|
|
|
#7 |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,861
Karma: 34252730
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
But - Mr Intuit suggested I try on a fresh install, and this is what I got:
So, I had a look at my Config, and decided to rename the "viewer_??????.json" files to "viewer_??????.json.save" When I ran the viewer, I got the same result. The only config file recreated was "viewer-webengine.json", it was 682 bytes - the one I renamed to "*.json.save" is 30,804 bytes. So, looks like the problem is caused by something in "viewer-webengine.json". Because I don't use Sepia dark I'm not going to investigate further, but I'm attaching a zip with two .json files, one of which exhibits the problem and one of which doesn't, I removed search and file history from the 30,804b file to create the 'bad' one in the zip. BR Last edited by BetterRed; Yesterday at 10:33 PM. Reason: forgot the zip file |
|
|
|
|
|
#8 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,527
Karma: 29634066
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I meant there is no mangling in the UI. As for the book itself, the explanation is what I originally posted. The book's CSS conflicts. It tries to be too clever by half and detect dark mode based on colors and apply CSS filters to transform images which conflicts with the CSS rules calibre sets for dark mode themes, again as I said in my original post (though in the other direction) turn off override all book colors and you wont have the issue.
And I guess I can make the override CSS in calibre a bit smarter to outsmart such books by explicitly setting the background color for images and other media elements to transparent so common filters have no effect. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Background color in Calibre 4 viewer | jbacelar | Calibre | 10 | 10-07-2019 09:21 PM |
| Calibre PDF Output: Adding Background Rgb colors customization options and Font Color | Lodan | 7 | 02-17-2019 09:09 AM | |
| Problem with font & background colors on the Ebook Viewer | darthktulu | Calibre | 3 | 10-27-2013 11:24 PM |
| Suggestion on choosing theme colors | slayda | Marvin | 22 | 09-17-2013 12:27 PM |
| How to edit skin/theme colors? | monkbythesea | Calibre | 7 | 08-02-2010 02:18 PM |