ReaderTheme

class ReaderTheme(val background: RgbColor, val mapColor: (RgbColor) -> RgbColor)

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.

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 yourself

Constructors

Link copied to clipboard
constructor(background: RgbColor, mapColor: (RgbColor) -> RgbColor)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Paper colour behind the page content.

Link copied to clipboard

Maps each content colour a page draws. Identity for Light.

Functions

Link copied to clipboard
fun wrap(canvas: KiteCanvas): KiteCanvas

Decorate canvas so its content colours are themed. Returns it unchanged for Light.