PdfViewColors

data class PdfViewColors(val pageBackground: Color = Color.White, val viewportBackground: Color = Color.Transparent, val theme: ReaderTheme? = null, val searchHighlight: Color = Color(0x66FFEB3B), val selectionHighlight: Color = Color(0x664285F4), val selectionHandle: Color = Color(0xFF4285F4), val selectionHandlePainter: PdfSelectionHandlePainter? = null)

Colours used by PdfView.

Parameters

pageBackground

painted behind page content (most PDFs assume white paper and paint nothing themselves). Ignored when theme is set. The theme owns the paper colour then.

viewportBackground

the letterbox/gutter colour around pages.

theme

optional reading theme (ReaderTheme.Dark/ReaderTheme.Sepia/ ReaderTheme.Light). When set, page content colours are remapped (text, borders, backgrounds, not images) and the paper uses the theme background. Reflowable EPUB especially benefits: night mode without re-laying-out.

Constructors

Link copied to clipboard
constructor(pageBackground: Color = Color.White, viewportBackground: Color = Color.Transparent, theme: ReaderTheme? = null, searchHighlight: Color = Color(0x66FFEB3B), selectionHighlight: Color = Color(0x664285F4), selectionHandle: Color = Color(0xFF4285F4), selectionHandlePainter: PdfSelectionHandlePainter? = null)

Properties

Link copied to clipboard
Link copied to clipboard

Fill for PdfViewState.searchHighlights quads, drawn over the page.

Link copied to clipboard

The caret-and-dot markers at the selection's two boundaries. Opaque on purpose where selectionHighlight is translucent: the wash says "this much is selected", the handles say exactly where that starts and ends, and a see-through boundary marker would say neither.

Link copied to clipboard

How each selection boundary marker is drawn. Null uses the built-in caret-and-dot (PdfSelectionHandleDefaults.CaretAndDot). The handles are canvas vector drawing, not composables: they live inside the page's draw pass so they scale, pan and zoom in lockstep with the words they bound, which an overlay composable could only approximate.

Link copied to clipboard

Fill for the active PdfViewState.selection quads.

Link copied to clipboard
Link copied to clipboard