Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Click Extra has been maintained for 5+ years, and is free to use. You can help if you 🤝 purchase business support or 🫶 sponsor the project.
Click Extra
Light Logo Dark Logo
  • Installation
  • Tutorial

Running and wrapping CLIs

  • CLI
  • Man pages
  • CLI wrapper

Building a CLI

  • Commands & groups
  • Decorators
  • Types
  • Context
  • Multicall binaries

Configuration

  • Configuration files
  • Configuration discovery
  • Configuration formats
  • Configuration schema
  • Configuration validation
  • Environment variables

Colors and output

  • Colored help
  • Themes
  • Styling
  • Layout
  • Table
  • Spinner

Runtime behavior

  • Logging
  • Execution
  • Version
  • Bug reports
  • Telemetry

Introspection and export

  • Parameters
  • Machine-readable help
  • Command tree
  • Carapace completion

Testing

  • CLI testing
  • Pytest
  • Test suites

Terminal captures

  • CLI screenshots
  • Code snippets
  • Man-page

Documenting a CLI

  • Sphinx
  • Python directives
  • MyST docstrings
  • Pygments
  • MkDocs

Comparisons

  • Typer compatibility
  • Benchmark

Contributing

  • Contribution guide
  • Downstream packaging
  • Binaries
  • Upstream
  • Code of conduct

API reference

  • click_extra package
    • click_extra.capture package
      • click_extra.capture.html module
      • click_extra.capture.presets module
      • click_extra.capture.recording module
      • click_extra.capture.screenshot module
      • click_extra.capture.snippet module
      • click_extra.capture.svg module
      • click_extra.capture.terminal module
    • click_extra.config package
      • click_extra.config.builtin module
      • click_extra.config.discovery module
      • click_extra.config.export module
      • click_extra.config.flags module
      • click_extra.config.formats module
      • click_extra.config.option module
      • click_extra.config.schema module
      • click_extra.config.subcommands module
    • click_extra.markdown package
      • click_extra.markdown.blocks module
      • click_extra.markdown.myst module
    • click_extra.sphinx package
      • click_extra.sphinx.announcement module
      • click_extra.sphinx.changelog module
      • click_extra.sphinx.click module
      • click_extra.sphinx.click_reference module
      • click_extra.sphinx.click_runner module
      • click_extra.sphinx.crosshair module
      • click_extra.sphinx.doctrees module
      • click_extra.sphinx.fail_on_warnings module
      • click_extra.sphinx.linkcheck module
      • click_extra.sphinx.manpages module
      • click_extra.sphinx.matrix module
      • click_extra.sphinx.mermaid module
      • click_extra.sphinx.myst_docstrings module
      • click_extra.sphinx.opengraph module
      • click_extra.sphinx.python module
      • click_extra.sphinx.tables module
      • click_extra.sphinx.tabs module
      • click_extra.sphinx.theme_docs module
      • click_extra.sphinx.todos module
      • click_extra.sphinx.viewcode module
    • click_extra.accessibility module
    • click_extra.ansi module
    • click_extra.blocks module
    • click_extra.bug_report module
    • click_extra.carapace module
    • click_extra.cli module
    • click_extra.cli_capture module
    • click_extra.cli_prebake module
    • click_extra.cli_wrapper module
    • click_extra.color module
    • click_extra.columns module
    • click_extra.command_doc module
    • click_extra.commands module
    • click_extra.context module
    • click_extra.decorators module
    • click_extra.envvar module
    • click_extra.execution module
    • click_extra.highlight module
    • click_extra.humanize module
    • click_extra.jobs module
    • click_extra.layout module
    • click_extra.logging module
    • click_extra.logo module
    • click_extra.mkdocs module
    • click_extra.multicall module
    • click_extra.output module
    • click_extra.param_tools module
    • click_extra.parameters module
    • click_extra.prebake module
    • click_extra.progress module
    • click_extra.project module
    • click_extra.pygments module
    • click_extra.pytest module
    • click_extra.show_params module
    • click_extra.spinner module
    • click_extra.spinner_presets module
    • click_extra.styling module
    • click_extra.table module
    • click_extra.table_options module
    • click_extra.telemetry module
    • click_extra.test_suite module
    • click_extra.testing module
    • click_extra.theme module
    • click_extra.trail module
    • click_extra.tree module
    • click_extra.types module
    • click_extra.version module
    • click_extra.version_facts module
  • tests package
    • tests.mkdocs package
      • tests.mkdocs.conftest module
      • tests.mkdocs.test_mkdocs module
    • tests.sphinx package
      • tests.sphinx.conftest module
      • tests.sphinx.test_sphinx module
      • tests.sphinx.test_sphinx_announcement module
      • tests.sphinx.test_sphinx_changelog module
      • tests.sphinx.test_sphinx_click module
      • tests.sphinx.test_sphinx_click_config module
      • tests.sphinx.test_sphinx_click_tree module
      • tests.sphinx.test_sphinx_crosshair module
      • tests.sphinx.test_sphinx_doctrees module
      • tests.sphinx.test_sphinx_fail_on_warnings module
      • tests.sphinx.test_sphinx_linkcheck module
      • tests.sphinx.test_sphinx_manpages module
      • tests.sphinx.test_sphinx_matrix module
      • tests.sphinx.test_sphinx_mermaid module
      • tests.sphinx.test_sphinx_myst_docstrings module
      • tests.sphinx.test_sphinx_opengraph module
      • tests.sphinx.test_sphinx_python module
      • tests.sphinx.test_sphinx_tables module
      • tests.sphinx.test_sphinx_tabs module
      • tests.sphinx.test_sphinx_todos module
      • tests.sphinx.test_sphinx_viewcode module
    • tests.conftest module
    • tests.tachyon_cast module
    • tests.test_accessibility module
    • tests.test_ansi module
    • tests.test_blocks module
    • tests.test_bug_report module
    • tests.test_carapace module
    • tests.test_cli_wrapper module
    • tests.test_color module
    • tests.test_command_doc module
    • tests.test_commands module
    • tests.test_config module
    • tests.test_config_discovery module
    • tests.test_config_flags module
    • tests.test_config_schema module
    • tests.test_context module
    • tests.test_docs_anchors module
    • tests.test_docs_api module
    • tests.test_docs_directives module
    • tests.test_envvar module
    • tests.test_execution module
    • tests.test_highlight module
    • tests.test_humanize module
    • tests.test_hygiene module
    • tests.test_jobs module
    • tests.test_layout module
    • tests.test_logging module
    • tests.test_logo module
    • tests.test_multicall module
    • tests.test_myst module
    • tests.test_output module
    • tests.test_parameters module
    • tests.test_prebake module
    • tests.test_progress module
    • tests.test_project module
    • tests.test_pygments module
    • tests.test_pyproject module
    • tests.test_pytest module
    • tests.test_readme module
    • tests.test_recording module
    • tests.test_screenshots module
    • tests.test_snippet module
    • tests.test_sphinx_crossrefs module
    • tests.test_spinner module
    • tests.test_styling module
    • tests.test_table module
    • tests.test_telemetry module
    • tests.test_terminal module
    • tests.test_test_suite module
    • tests.test_testing module
    • tests.test_theme module
    • tests.test_trail module
    • tests.test_tree module
    • tests.test_types module
    • tests.test_utils module
    • tests.test_version module
  • Index
  • Module Index

Project

  • Changelog
  • Todo list
  • License
  • GitHub repository
  • Funding
Back to top
View this page
Edit this page

click_extra.logo module¶

Terminal rendition of the Click Extra brand mark.

The mark of docs/assets/logo-square.svg is six cubes stacked three-two-one. Here they are rebuilt as flat shaded solids, with one color per face and no outline anywhere, and painted with half blocks, two sub-pixels to a terminal line.

Flat faces are what let one palette serve a light terminal and a dark one. An outlined mark carries its shape in the outline, so every stroke has to out-contrast whatever sits behind it, and the artwork’s own palette spans too wide a range for that: six of its colors vanish on white, two more on black. A flat mark carries its shape in the difference between its three planes, which no background can touch, leaving only the silhouette to keep its distance. That fits comfortably in the middle of the range, which is where FACE_COLORS sits.

Caution

The mark’s structure is carried by color: strip the ANSI codes and it collapses into one silhouette. VersionScreen therefore only draws it where color reaches the output, falling back to the plain --version line everywhere else, which is also the form machine readers parse.

click_extra.logo.TAGLINE = 'Drop-in replacement for Click and Cloup'¶

What the project is, spelled out under the program name.

click_extra.logo.UNIT = 2¶

Scale of the whole mark, in sub-pixels.

Every dimension is a multiple of it, so the mark is 12 * UNIT columns wide and 5 * UNIT lines tall. Two is the largest that still seats the mark beside the version screen’s facts inside eighty columns: 24 columns of mark, three of gutter and fifty of facts comes to 77. Three would need 89, and the screen would decline to draw itself on any standard terminal.

click_extra.logo.LEVELS: tuple[tuple[int, int], ...] = ((0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (2, 0))¶

Each cube’s (row, column) up the pyramid, bottom row first.

Also the order FACE_COLORS is written in, and the order the mark is painted in: a cube resting on two others has to be laid down after them.

click_extra.logo.BRAND_HUES: tuple[int, ...] = (41, 94, 306, 279, 210, 156)¶

Each cube’s hue in degrees, in LEVELS order.

Read off the ribbon that outlines each cube’s top face in the artwork. The mark has no per-cube hue of its own: cube one alone carries gold, green and olive across its six ribbons. So this is a reading of the artwork rather than a recovery of it. It keeps the terminal mark recognizably the same six colors people already associate with the logo, which an evenly spaced spectrum would not.

click_extra.logo.SATURATION = 0.62¶

HLS saturation shared by every face. Vivid enough to tell six hues apart.

click_extra.logo.PLANE_LUMINANCE: dict[str, float] = {'l': 0.13, 'r': 0.22, 't': 0.36}¶

WCAG relative luminance per plane: the lid, then the two walls.

Chosen as a band rather than per color, so every hue is equally far from both backgrounds. The floor of the band is what the mark shows against white and the ceiling what it shows against black, which is why it sits in the middle: the widest band tried reads beautifully on black and falls to 1.74:1 on white.

The 2.25:1 it leaves between a cube’s lid and its dark wall is well past what an eye needs to see a facet, and it survives every dichromacy, planes differing in luminance alone.

click_extra.logo.FACE_COLORS: tuple[dict[str, str], ...] = ({'l': '#7F611E', 'r': '#A37B26', 't': '#CB9A30'}, {'l': '#40721B', 'r': '#519122', 't': '#66B52A'}, {'l': '#AD28A1', 'r': '#D344C6', 't': '#E17FD8'}, {'l': '#9730CC', 'r': '#AE5ED9', 't': '#C58CE4'}, {'l': '#2767A8', 'r': '#3985D0', 't': '#70A7DD'}, {'l': '#1B724F', 'r': '#229265', 't': '#2BB87F'})¶

Each cube’s three face colors, in LEVELS order.

Derived, not picked: every entry is its cube’s BRAND_HUES hue at SATURATION, taken to the luminance its plane declares in PLANE_LUMINANCE. Written out rather than computed at import so the palette stays greppable and a designer can hand-tune one value; test_palette_follows_its_derivation fails if a tuned value drifts off the system.

Emitted as 24-bit color. The 256-color cube cannot separate all eighteen, and the usual reason to prefer it does not apply: no touching pair of faces collides there, so a terminal that downsamples still shows six distinct cubes.

click_extra.logo.geometry()[source]¶

One cube’s dimensions, in sub-pixels.

A lid four units wide and two tall is 2:1 dimetric, and the smallest such rhombus whose half-height is a whole number, which the row pitch needs. The body matches the lid’s width over two, making every box a true cube.

Return type:

dict[str, int]

click_extra.logo.size()[source]¶

The mark’s footprint in sub-pixels, columns by rows.

Return type:

tuple[int, int]

click_extra.logo.LOGO_WIDTH = 24¶

Columns the mark occupies.

click_extra.logo.LOGO_LINES = 10¶

Terminal lines the mark renders to, two sub-pixel rows making one.

click_extra.logo.faces()[source]¶

Every visible face, bottom row first, as whole-sub-pixel polygons.

2:1 dimetric rather than the artwork’s 30 degrees, and integer vertices rather than a sampled rendering, for the same reason: a 30-degree edge advances 1.732 sub-pixels per row, which no grid can hold, so it comes out as a stair of uneven treads that the eye reads as fraying. Two across for every one down tiles a square grid exactly, and every tread is then the same.

Return type:

list[tuple[int, str, list[tuple[int, int]]]]

click_extra.logo.sub_pixels()[source]¶

The mark as a grid of flat colors, hit-tested against the face polygons.

Rasterizing the mark and reading pixels back would hand the antialiaser a say in the palette: every boundary it smooths mints a color belonging to neither face, and a rendition this size comes back carrying over a hundred of them. Testing each sub-pixel’s centre against the polygons keeps it to the eighteen declared, three per cube, which is what makes the edges read as steps rather than smudge.

Return type:

list[list[tuple[int, int, int] | None]]

click_extra.logo.render_logo()[source]¶

Paint the mark into styled lines, each exactly LOGO_WIDTH wide.

A cell whose two sub-pixels carry different colors paints the top one as foreground over the bottom one as background, which is what fits two independent colors on one line. Runs of cells sharing a color pair are styled together rather than one escape sequence per character, keeping the mark from tripling in size.

Trailing blanks are kept: VersionScreen pads a ragged logo for us, but a mark that arrives square costs it nothing to measure.

Cached: the mark never changes, so it is painted on the first call that needs it and read back by every later one.

Return type:

tuple[str, ...]

click_extra.logo.brand_facts()[source]¶

The interpreter and platform every screen reports, plus this project’s own.

Return type:

dict[str, str]

click_extra.logo.BRAND_SCREEN = VersionScreen(logo=<functools._lru_cache_wrapper object>, tagline='Drop-in replacement for Click and Cloup', facts=<function brand_facts>, gutter='   ')¶

Click Extra’s own --version screen.

Mounted on the click-extra CLI, and the shape a CLI of your own would copy:

from functools import partial
from click_extra import group
from click_extra.commands import default_params

@group(params=partial(default_params, screen=BRAND_SCREEN))
def cli():
    pass

Both render_logo() and brand_facts() are passed uncalled, so the mark is painted and the facts are read when --version is drawn, not when this module is imported: the habit that keeps a costlier value from being charged to every invocation. The mark is then cached, since it never changes.

Next
click_extra.mkdocs module
Previous
click_extra.logging module
Copyright © Kevin Deldycke and contributors
Made with Furo
Last updated on 2026-11-26
On this page
  • click_extra.logo module
    • TAGLINE
    • UNIT
    • LEVELS
    • BRAND_HUES
    • SATURATION
    • PLANE_LUMINANCE
    • FACE_COLORS
    • geometry()
    • size()
    • LOGO_WIDTH
    • LOGO_LINES
    • faces()
    • sub_pixels()
    • render_logo()
    • brand_facts()
    • BRAND_SCREEN