本文へ移動

Taisen Brackets対戦

対戦の一覧から、トーナメント表をSVGで描きます。

対戦(たいせん)は、二者が向かい合って勝負することです。 名前について(英語)

目次

リファレンス · トーナメント表・表・決勝までの道を描く

resolveBackground関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { resolveBackground } from "@johnmorrisdotca/taisen-brackets";

定義

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

引数

名前型説明
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.

戻り値

ResolvedBackground | null

The background; null when the option asks for none.

例

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

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/taisen-brackets 0.20.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。