Skip to content

Use a logo that is visible on a white page - #10

Merged
ShahriarAhnaf merged 3 commits into
mainfrom
agent/logo-contrast-8e14
Aug 25, 2026
Merged

Use a logo that is visible on a white page#10
ShahriarAhnaf merged 3 commits into
mainfrom
agent/logo-contrast-8e14

Conversation

@ShahriarAhnaf

@ShahriarAhnaf ShahriarAhnaf commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

The 0.3.0 README shipped the white logo, so on PyPI it rendered white on white. The wordmark vanished and a reader saw a stray dot floating above the tagline.

The file names are the trap. Measured mean luminance of the visible (non-transparent) pixels:

file luminance actually is
simantic_logo_4_full_transparent.png 252 light, needs a dark background
simantic_logo_4_inverted_full_transparent.png 3 dark, needs a light background
simantic_logo_4_full.png 41 white mark on its own opaque black card

Both transparent files only work on one background: the dark one is barely legible in GitHub's dark mode, the light one is invisible on PyPI. Serving them by colour scheme with a <picture> works, but it means two files to keep in sync for a logo.

simantic_logo_4_full.png carries its own black card, so a single <img> renders identically on PyPI's white page and on GitHub in dark mode. One file, nothing conditional, nothing to keep in sync.

Bumped to 0.3.1, because a release's description on PyPI is immutable after upload. The 0.3.0 page keeps the invisible logo no matter what lands on main; only a new version changes what people see.

The README shipped the white logo, so on PyPI it rendered as white on white:
the wordmark was invisible and all a reader saw was a stray dot. The file names
are the trap. simantic_logo_4_full_transparent.png is the light one (mean
luminance 252, for dark backgrounds) and the file called "inverted" is the dark
one (luminance 3).

Uses a <picture>, so both cases are right rather than trading one for the
other. GitHub honours the dark-scheme <source> and shows the white logo in dark
mode; PyPI's sanitiser drops <source> and keeps the <img>, which is the dark
logo on their white page. Verified against readme_renderer, the library PyPI
renders with.

Bumped to 0.3.1 because a release's description on PyPI cannot be edited after
upload; the page only changes when a new version is published.
Rather than serve two files by colour scheme, use the variant that carries its
own black card. It renders the same on PyPI's white page and on GitHub in dark
mode, so there is one image and nothing to keep in sync.
test_version_matches_pyproject caught the half-done bump: pyproject said 0.3.1
while simantic.__version__ still said 0.3.0. That test exists because a release
tags one version and two sources of truth drift silently.
@ShahriarAhnaf
ShahriarAhnaf merged commit 3d1877c into main Aug 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant