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
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.