Module Hugin.Theme

Visual themes.

Visual themes.

A theme controls every non-data visual element: background color, typography, axes, grid, spacing, and default data palettes.

Themes separate two orthogonal concerns: style (aesthetic appearance) and context (scaling for the output medium). The paper, notebook, talk, and poster functions adjust scale_factor to uniformly scale all visual elements for the target medium.

Types

type font = {
  1. family : string;
  2. size : float;
  3. weight : [ `Normal | `Bold ];
}

The type for font specifications. size is in points before scale_factor is applied.

type line = {
  1. color : Color.t;
  2. width : float;
  3. dash : float list;
}

The type for line styles. dash is a list of on/off lengths; empty means solid.

type t = {
  1. background : Color.t;
  2. palette : Color.t array;
  3. sequential : Cmap.t;
  4. diverging : Cmap.t;
  5. font_title : font;
  6. font_label : font;
  7. font_tick : font;
  8. axis : line;
  9. grid : line option;
  10. tick_length : float;
  11. padding : float;
  12. title_gap : float;
  13. label_gap : float;
  14. scale_factor : float;
  15. line_width : float;
  16. marker_size : float;
}

The type for themes. All dimensional values (font sizes, line widths, gaps) are multiplied by scale_factor at render time.

Predefined themes

val default : t

default is a light theme with subtle grid, Okabe-Ito categorical palette, and Tufte-informed defaults.

val dark : t

dark is a dark-background theme.

val minimal : t

minimal is a theme with no grid and thin axes.

Context scaling

val paper : t -> t

paper t is t with scale_factor = 1.0.

val notebook : t -> t

notebook t is t with scale_factor = 1.3.

val talk : t -> t

talk t is t with scale_factor = 1.6.

val poster : t -> t

poster t is t with scale_factor = 2.0.