cover

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cover generates and renders book cover pages. It builds a styled HTML cover from book metadata such as title, author, and version.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLightColor added in v0.7.14

func IsLightColor(color string) bool

IsLightColor reports whether the given CSS color is perceptually light. It understands hex colors (#rgb, #rgba, #rrggbb, #rrggbbaa), common named CSS colors, and numeric rgb()/rgba() forms. Unknown or unparseable formats are assumed dark so that light text remains the safer default. Alpha channels are ignored.

Types

type CoverGenerator

type CoverGenerator struct {
	// contains filtered or unexported fields
}

CoverGenerator builds the HTML cover page.

func NewCoverGenerator

func NewCoverGenerator(meta config.BookMeta, thm *theme.Theme) *CoverGenerator

NewCoverGenerator creates a new cover generator from book metadata and the active theme (nil theme falls back to built-in defaults).

func (*CoverGenerator) RenderHTML

func (cg *CoverGenerator) RenderHTML() string

RenderHTML returns a self-contained HTML cover page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL