
: Maintain font color when changing background color in ebook The chapter headings and some specific lines in the book are red font, which shows up fine in normal (white background) reading mode.
The chapter headings and some specific lines in the book are red font, which shows up fine in normal (white background) reading mode. But when toggling the kindle/e-reader to black or sepia background, the red font changes to white/brown along with the rest of the text. Any way to avoid this and maintain the red font regardless of the background? I'm using a very simple css for it:
p.red {color:#f00;}
Free books android app tbrJar TBR JAR Read Free books online gutenberg
More posts by @Angela

: How do you create and add a .apnx file to a Kindle book to display real page numbers? I have a decent amount of experience creating epub files and converting them to .mobi using Kindlegen

: How can I get an HTML input converted to PDF at 6x9" or otherwise for KDP paperback creation? I am trying to get from HTML originally intended for Kindle formats, to an output appropriate
2 Comments
Sorted by latest first Latest Oldest Best
Amazon may have resolved this for us, or it's just one of those things that worked itself out. I haven't changed the CSS at all after posting the question, but I DID convert the book to KFX format using the plugin for Calibre, and the renamed the KFX file with a .mobi extension, opened it in Kindle for Mac, and viola the colors are sticking:
What you're seeing here is red font displayed in "night mode" - so I don't know if it's a factor of the "basic" mobi format (which would have changed this to white text) versus the KFX format (which is what Amazon delivers to a buyer through the Kindle store), but I would presume that this would be preserved through the KDP publishing process. Never a guarantee though.
PS sorry, I don't have time tonight to post how I went through the above process, but I can if someone needs it and leaves a comment.
Free books android app tbrJar TBR JAR Read Free books online gutenberg
To accomplish this, you would need to write a css media query supported in kindle which detects whether night mode is activated.
Here's a two year old thread about the topic. Not very useful, btw, and they go off on a tangent. They offer advice about how to create css media queries to target specific devices. This is not a good strategy for dealing with the issue.
You should download the latest Amazon Publishing Guidelines and maybe ask on the KDF technical formatting forum whether someone had stumbled upon a solution. I just looked there and found nothing.
In web browsers, you can make a css media query to detect night mode by matching color; ie, if color=black, then use this css color, etc. But that wouldn't work on a specific platform like Kindle, I'm guessing.
The thinking behind night mode is to provide complimentary colors. Its algorithm for determining what is complimentary is not documented yet, nor do I know a css media query for Kindle which you can use. It would require a good amount of testing to figure it out on your own, I'm guessing.
At the moment, I don't see an easy way to accomplish what you want -- though there probably is a need. That said, I do generally trust the algorithms in night mode which try to maximize contrast.
Free books android app tbrJar TBR JAR Read Free books online gutenberg