Skip to the content

Taisen Brackets対戦

Knockout brackets as SVG, from a list of ties.

Taisen (対戦, たいせん) is Japanese for a matchup: two sides facing each other. About the name

Contents

Reference · Draw a bracket, a table or a road to the final

resolveBackgroundfunction

Reads the background option for a drawing width by height in the look theme, with prefix for the ids. Returns null when the option is true, false or left out (a plain colour, or none). An unknown preset, a bad colour list or an image address that is not http(s), relative or data:image/… throws a RangeError.

Import it

import { resolveBackground } from "@johnmorrisdotca/taisen-brackets";

Definition

function resolveBackground(option: unknown, theme: ThemeName, width: number, height: number, prefix: string): ResolvedBackground | null

Parameters

NameTypeDescription
optionunknown

The background option of a drawing.

themeThemeName

The theme the drawing is in.

widthnumber

The drawing's width.

heightnumber

The drawing's height.

prefixstring

The prefix of the drawing's ids.

Returns

ResolvedBackground | null

The background; null when the option asks for none.

Examples

import { resolveBackground } from "@johnmorrisdotca/taisen-brackets";

console.log(resolveBackground(false, "light", 400, 300, "tb"), resolveBackground("ice", "light", 400, 300, "tb") !== null);
null true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/taisen-brackets 0.20.0.