本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス · トーナメント表の背景

BackgroundSvgOptions型

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

What a background is drawn for: its width and height, the theme, colours, angle, intensity and seed.

インポート

import type { BackgroundSvgOptions } from "@johnmorrisdotca/taisen-brackets/backgrounds";

ほかのエクスポート元: @johnmorrisdotca/taisen-brackets

定義

type BackgroundSvgOptions = shared.BackgroundSvgOptions;

メンバー

名前型説明
widthnumber
heightnumber
theme (省略可)"light" | "dark" | undefined

dark (the default) or light: which of the preset's two palettes. With your own colors, the ink follows what they are.

colors (省略可)readonly string[] | undefined

Your own colours, as hex (#0b1230) or rgb(): the first two make the ground, the third and fourth the glow and the pattern. Fewer than four keep the preset's for the rest.

angle (省略可)number | undefined

The angle of the ground's gradient and of the pattern over it, in degrees as CSS has it (180 is top to bottom). The preset's own by default; a playing surface keeps its lines straight.

intensity (省略可)number | undefined

How strong the pattern and glow are, 0 to 1. Default 0.6.

seed (省略可)number | undefined

Moves the scattered parts (confetti, stars, scratches, contours). Default 1.

id (省略可)string | undefined

The prefix of the ids the background writes. Default: a hash of its options. Only letters, digits, _ and - are kept (every other character becomes -), and bg- goes in front of one that does not start with a letter; a safe id is used as written.

例

import { backgroundSvg, type BackgroundSvgOptions } from "@johnmorrisdotca/taisen-brackets/backgrounds";

const options: BackgroundSvgOptions = { width: 1200, height: 675, theme: "dark", seed: 3 };
console.log(backgroundSvg("aurora", options).ink.dark);
true

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

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

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