ReaderTheme
A reading theme: a page background plus a mapColor transform applied to every text / vector / border / CSS-background colour a page paints. Images and gradients pass through untouched, so photos never invert. withImages lets the theme recolour the images that are line art too.
Dark and Sepia keep text readable: a colour with a contrast of 4.5 or more on white paper keeps at least 4.5 on the theme's paper, and a weaker colour keeps the contrast it had (WCAG 2.2, 1.4.3).
Format-neutral: it themes any KiteCanvas (PDF or EPUB). Hand a theme to a rasterizer, or wrap a canvas yourself:
page.renderTo(ReaderTheme.Dark.wrap(canvas), ctm) // paint background yourselfTwo themes are equal when they share the paper colour and the same colour function, so a theme built inline with a lambda that captures nothing stays one cache key across recompositions.
Properties
Paper colour behind the page content.
What the theme does to images: ReaderImages.Unchanged unless withImages says otherwise (#458).
Functions
This theme, doing images to the images of a page. With ReaderImages.LineArt, a black symbol on white turns as light as the text on dark paper, and a photo keeps its colours: