Picks the colour and the letter of ThumbnailPlaceholder. The CSS mixes the tint into the theme's surface (--thumb-tint) rather than painting it alone, so the text keeps its contrast whatever the site's colour and the theme.

Functions

f
initialsFor(
siteName: string | undefined,
url: string | undefined
): string

Returns the letter drawn when there's no favicon to show, the first letter or digit of siteName, or else of the hostname of url, or "?".

f
tintFor(unnamed 0: { accentColor?: string; url?: string; seed?: string; }): string

Returns the page's own colour when it declared a valid one, or else a hue drawn from seed or the hostname of url, so that every card gets a tint, even for a dump saved before colours were extracted.

Usage

import * as mod from "src/utils/shared/thumbnailTint.ts";