![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
A possible new feature for Sigil 1.9.11?
Right now, Sigil has the option to make Preview simulates a dark appearence in dark mode. Would it be possible to add a new option when the user has opted for a dark appearence, that the Preview Panel shows colors inverted? (just in PP). For example, instead of showing "red" (rgb(255, 0, 0), it shows rgb(0, 255, 255) (or in hexadecimal, instead of #ff0000, is displayed #00ffff). So, instead of showing the "user_color", it shows (white - user_color = color_displayed). All this, as an option of course, because many users of dark mode very possible won't like this way of displaying colors in PP.
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not sure I follow. There is no "user color" for Preview. There is the book's css. The only thing dark appearance in Preview does is attempt to inject (via css) text/background colors. i.e. white text with the current Window color for background. And it only works if the ebook hasn't already explictly set text/backgound colors via css.
I'm just not certain we could offer anything "inverted", since we have no way of knowing what theming (either with style plugins on Linux, or custom css on all platforms) is already in play. The current Window background color and light text is only a compromise. One that I'm not sure we can (or should) offer any alternatives for. It's already very fragile as it is. That's why it's not enabled by default when Sigil is using a dark theme. The custom preview css feature would be better suited for those who wish to customize their dark-mode (or any mode for that matter) Preview colors in my opinion. Remember that the inherent dark mode you're likely forcing on Sigil (with the environment variable) on Linux is only one of many dark themes that are available to Linux users via custom Qt theming engines and Qt style plugins. We use the background color of the current theme and light text to approximately match everything. And as mentioned, it only works when ebooks don't force their own text/background colors. Last edited by DiapDealer; 06-27-2022 at 02:42 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Unless I'm mistaken (and I may be: Kevin can probably answer better), getting Preview to analyze an ebook's css and then attempt to inject complimentary colors would be no small feat. We currently inject our dark colors into Preview blindly whenever the checkbox is selected. That kind of parsing each and every time Preview is refreshed could add considerable processing overhead. I'm not even certain how we would go about determining which colors we would be "inverting". What if there are no defined colors in the stylesheet? What if there are tons?
Last edited by DiapDealer; 06-27-2022 at 02:55 PM. |
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
|
@RbnJrg: Try use this code in custom_preview_style.css file:
Code:
:root { background-color: initial!important; color: initial!important; filter: invert(1);} |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Becky, your solution is perfect, brillant, for .css colors; it's exactly what I wanted. But there is an issue, the background-color appears as white. By removing "background-color: initial!important;" doesn't fix the problem. And neither has effect to uncheck the option "Make preview simulate..." Any idea about how to solve this drawback? I'm working in Arch Linux with a custom build of Sigil with Qt6.
|
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Did you remember to disable the Dark setting for Preview in Sigil Settings?
|
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
|
Hmmm,
What if you just added background-color: black; to the CSS file? (It works for me) |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
body { background-color: initial !important; color: initial !important; filter: invert(1); } EDIT: By the way, maybe Kevin or Diap could add as an option your very smart style "filter: invert(1)" in dark mode, so by checking or unchecking the option, the user would have both alternatives. Last edited by RbnJrg; 06-27-2022 at 05:50 PM. |
|
![]() |
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Unless I am missing something (and I easily could be) to be useful the epub would have to use many different colours of text before this makes any sense.
Given how much of a pain adding options can be, I do not think adding an option for this makes a lot of sense, given the few people who would use it. Especially considering the custom_preview_style.css approach can do what you want. What advantage does this provide for a typical epub? Last edited by KevinH; 06-28-2022 at 10:01 AM. |
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
What's further... the fact that Linux themes allow many different hues of "dark" background (black, blue, dark grey, brown, etc...), there is still no guarantee that an inverse text color will even be compatible with the Preview background color.
To me... this is exactly why the custom_preview_style.css feature was added in the first place. |
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Try to use for example in dark mode an style like "border: 2px solid black" and tell me if you can see the border. Or try to use borders for a table, or a table-cell (black borders) and tell me if you can see them. Do you think that in a typical epub nobody will use a table with borders, or nobody will use a border for text? Or do you think that can be very strange to use capital letters inverted? (that is, on a black background, a white letter). In dark mode, you can't see that effect. But I'm going to do the things easier for you: open the epub I attach in dark mode and watch how it looks with the style "filter: invert(1)" enabled and disabled (and with color: initial !important and background-color: initial !important).
With dark mode you can't see colors like darkblue, or navy, etc., etc. but when the filter is appied, the layout based on colors can be appreciated. The ideal would be to have a tool to enabled and disabled the style filter: invert(1) with one click (or to have a shortcut to do that) according to the circunstances. Last edited by RbnJrg; 06-28-2022 at 11:52 AM. |
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,633
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
But your suggestion still won't guarantee the inverted colors will be visible. That's what I keep trying to say. You're focused on dark = black. And that's just because you're using the dark mode that ships with Sigil that uses black. Not everyone (and frankly not that many at all) does on Linux. They use a system supplied Qt theme for Sigil. And the background of another dark theme on linux could just as well be maroon, or dark gray.
There will never be a good (let alone failsafe) way to override an ebook's css colors. For darkmode or any other other reason. And much work to attempt to do so (for an editor no less--not even a reader) doesn't make a lot of sense to me. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Feature requested for Sigil 1.7 | RbnJrg | Sigil | 23 | 08-06-2021 08:44 AM |
Need Feedback on UserDictionaries feature of Sigil | KevinH | Sigil | 11 | 08-29-2020 02:19 PM |
A few Sigil Feature Requests | crankypants | Sigil | 6 | 11-03-2015 09:56 AM |
Parity feature with Sigil | roger64 | Editor | 8 | 03-17-2014 11:28 AM |
Is auto-relinking a Sigil feature? | dlw | Sigil | 2 | 06-27-2011 12:43 AM |