Metadata-Version: 2.5
Name: hwostyle
Version: 1.7.0
Summary: Matplotlib style sheets and utilities for HWO direct imaging figures. Dual-mode dark (talks) and light (papers) themes with domain-specific colormaps.
Project-URL: Homepage, https://github.com/HabitableWorldsObservatory/hwostyle
Project-URL: Issues, https://github.com/HabitableWorldsObservatory/hwostyle/issues
Author-email: Corey Spohn <corey.a.spohn@nasa.gov>
License: MIT License
        
        Copyright (c) 2026 Corey Spohn
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.11
Requires-Dist: cycler
Requires-Dist: matplotlib>=3.8
Requires-Dist: tol-colors
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Provides-Extra: docs
Requires-Dist: ipython; extra == 'docs'
Requires-Dist: matplotlib; extra == 'docs'
Requires-Dist: myst-nb; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-autoapi; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
Requires-Dist: sphinx-book-theme; extra == 'docs'
Provides-Extra: test
Requires-Dist: colorspacious; extra == 'test'
Requires-Dist: nox; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Description-Content-Type: text/markdown

# hwostyle

Matplotlib style sheets and utilities for HWO direct imaging figures.

## Installation

```bash
pip install hwostyle
```

For development:
```bash
git clone https://github.com/HabitableWorldsObservatory/hwostyle.git
cd hwostyle
pip install -e ".[dev,test]"
```

## Quick Start

```python
import hwostyle

# Switch to paper mode (white background, muted colors)
hwostyle.use("light")

# Switch to talk mode (black background, neon colors)
hwostyle.use("dark")

# Access the palette
colors = hwostyle.palette
colors.cyan   # '#08F7FE' in dark, '#0097A7' in light

# Use domain-specific colormaps
cmap = hwostyle.cmaps.intensity   # PSF images
cmap = hwostyle.cmaps.residual    # difference maps
cmap = hwostyle.cmaps.phase       # wavefront error
cmap = hwostyle.cmaps.statistic   # signed statistics, SNR maps (Tol nightfall)

# Brand roles: name the entity, not the color
hwostyle.roles.planet
hwostyle.roles.positive           # certified claim
```

## Modes

| Feature | Dark (Talks) | Light (Papers) | Barbie |
|---------|-------------|----------------|--------|
| Background | Black | White | White |
| Colors | Neon (high saturation) | Muted (print-safe) | RdPu pinks |
| Line width | 2.5 | 1.5 | 1.0 |
| Font | Sans-serif | Sans-serif | Serif |
| Readout cmap | `magma` | `magma` | `magma` |
| Intensity cmap | Tol `iridescent_r` | Tol `iridescent_r` | `RdPu` |

Paper mode (`hwostyle.use("paper")`) is the white-page mode for publications. Its
default palette family is `tol` (Tol muted), and its curve roles follow that set
(planet is indigo). The earlier Tol light set stays available as the `tol-light`
family: `hwostyle.use("paper", "tol-light")`. Image colormaps are the same in every
mode (see Image colormaps below).

## Color Palette

| Name   | Dark         | Light       |
|--------|-------------|-------------|
| Cyan   | `#08F7FE`   | `#0097A7`   |
| Pink   | `#FE53BB`   | `#C2185B`   |
| Yellow | `#F5D300`   | `#F9A825`   |
| Green  | `#00FF41`   | `#2E7D32`   |
| Red    | `#FF0000`   | `#D32F2F`   |
| Purple | `#9467BD`   | `#7B1FA2`   |

### Roles

A role is what a plotted entity is; it resolves to one color per theme.
Palette-backed roles follow the palette family; fixed roles keep their
color in every family (paper and barbie use the light value).

| Role | Dark | Light | Use |
|------|------|-------|-----|
| `star` | yellow | yellow (`#92924F` in paper) | stars |
| `planet`, `measured`, `data` | cyan | cyan | planets, measured data |
| `model`, `predicted` | pink | `#882255` | model output, posterior draws |
| `highlight` | pink | pink | emphasis text |
| `reference` | green (`#117733` in dark) | `#7A9F56` | reference curves |
| `zodi` | same as `reference` | same | local zodiacal light; never in a clip with `reference`, `alert` or `posterior` |
| `disk` | `#9251BD` | `#6A1B9A` | disks |
| `envelope` | purple | purple | envelopes (deprecated) |
| `alert` | red | `#B71C1C` (`#C32D22` in paper) | a wrong verdict, a warning |
| `prior` | `#9251BD` | `#6A1B9A` | prior curves |
| `positive` | `#4C8DFF` | `#1565C0` | verdict: certified claim |
| `negative` | `#FF8C1A` | `#E65100` | verdict: rejected claim |
| `posterior` | `#B38A61` | `#662506` | posterior curves (not `model`) |
| `truth` | `#9A9A9A` | `#757575` | scenery and true values |

### Motifs

`hwostyle.motifs` is the default table of recurring objects (star, planet,
disk, detector, cue, and so on) as plain data. Each row names a color role or a
neutral rank and the non-color channels (marker, line style, hatch, arrow
style, font style) that keep it identifiable when the color is shared, dimmed
or lost to color vision. `motifs.motif_color(key, mode)` resolves a row's
color and `motifs.motif_label_color(key, mode)` the text color for its label
(a lighter or deeper ink for the dark green and purple and the light green,
whose marks are too faint to read as words); nothing in the table draws. A figure spends at most `motifs.HUE_BUDGET`
(4) hues. `motifs.SHARING_SETS` lists hue pairs that never appear in the same
clip (`disk` with `prior`, `local_zodi` with `reference`, `alert` or
`posterior`), `motifs.ACCEPTED_PAIRS` lists the few co-occurring hues left
under 10 dE on purpose, each with the channels that must differ, and
`motifs.EXCLUSION_PAIRS` lists image roles that never share a figure. The cue
is a ring, band or underlay in the text color and spends no hue.
`motifs.DIM_LEVELS` gives the opacity of a finished step: 0.35 in dark mode and
0.5 in light and paper.

### Image colormaps

Image roles use Paul Tol maps (through `tol-colors`), the same in light, dark and
paper modes. For the sequential maps the page decides the orientation: low
values sit at the page end.

| Role | Map | Use |
|------|-----|-----|
| `intensity` | Tol `iridescent_r` | idealized model images, low = dark |
| `readouts` | `magma` | detector readouts and processed data |
| `probability` | Tol `YlOrBr` (reversed on black) | posterior and scatter density |
| `pupil` | Tol `WhOrBr` (reversed on black) | pupil transmission |
| `mask` | two grays | validity masks and binary apertures |
| `opd` | Tol `PRGn_r` | signed wavefront error |
| `residual` | Tol `BuRd` | difference images |
| `statistic` | Tol `nightfall_r` | signed statistics and SNR maps |
| `phase` | `twilight` | cyclic phase |

Pupil and probability share their colors, so they never appear in the same
figure. `brand_intensity` stays the brand ramp. `cmaps.high_dynamic_range` and
`roles.envelope` are deprecated and warn; use `intensity` or `readouts`, and the
parent series color for a band.

### Barbie Palette

| Name    | Hex       |
|---------|-----------|
| Blush   | `#FAA6B7` |
| Rose    | `#F768A1` |
| Magenta | `#D42A92` |
| Berry   | `#9A017B` |
| Plum    | `#5E006F` |
