View Single Post
Old 04-02-2019, 01:25 AM   #1
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
KePub reader reports colour media on e-ink

I have a small number of books with colour images that look good on a colour display but very bad on a greyscale display, so I want to make custom greyscale images that only display on greyscale devices, and continue to display the colour images on colour-capable devices.

I made an ePub book that checks whether the display is colour-capable, and can select the appropriate image. It uses @media queries and Adobe XPGT conditionals so should work on both of Kobo's readers, ePub and KePub, and It also seems to work okay in Calibre. But I noticed that on my Glo the KePub reader is reporting that it has a colour display.

(Edit: I should add that the firmware version is 4.8.11073)

Maybe I don't understand how the @media queries work? Or maybe it is a problem with the KePub reader? This is the query code I used:
Code:
div.display-iff-color-unknown { display: block; }
div.display-iff-color { display: none; }
div.display-iff-not-color { display: none; }

@media (color) {
    div.display-iff-color-unknown { display: none; }
    div.display-iff-color { display: block; }
    div.display-iff-not-color { display: none; }
}

@media (max-color: 0) {
    div.display-iff-color-unknown { display: none; }
    div.display-iff-not-color { display: block; }
    div.display-iff-color { display: none; }
}
and the HTML to show the result:
Code:
  <div class="display-iff-color-unknown">
    <p>Color: Unknown</p>
  </div>
  <div class="display-iff-color">
    <p>Color: Yes</p>
  </div>
  <div class="display-iff-not-color">
    <p>Color: No</p>
  </div>
Attached is a simple ePub example (Edit: Updated to fix ePub orientation result, didn't affect KePub color result.)
Attached Files
File Type: epub media-test.epub (3.2 KB, 56 views)

Last edited by GeoffR; 04-02-2019 at 04:38 AM. Reason: firmware version, replaced faulty attachment
GeoffR is offline   Reply With Quote