BackgroundOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A preset, tuned: your own colours (hex or rgb(), the first two the ground), the gradient's angle, how strong the pattern is (0 to 1, default 0.6), a seed for the scattered parts, and which of its two variants.
インポート
import type { BackgroundOptions } from "@johnmorrisdotca/taisen-brackets/layout";
ほかのエクスポート元: @johnmorrisdotca/taisen-brackets
定義
interface BackgroundOptions {
preset?: BackgroundPresetName;
colors?: readonly string[];
angle?: number;
intensity?: number;
seed?: number;
theme?: "light" | "dark";
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
preset (省略可) | "midnight" | "crimson" | "royal" | "emerald" | "pitch" | "ice" | "hardwood" | "infield" | "turf" | "ball-panels" | "swirl" | "waves" | "glow" | "floodlights" | "confetti" | "carbon" | "aurora" | "sunburst" | "chevrons" | "halftone" | "argyle" | "contour" | "stardust" | "mesh" | "spotlight" | undefined | Default |
colors (省略可) | readonly string[] | undefined | |
angle (省略可) | number | undefined | |
intensity (省略可) | number | undefined | |
seed (省略可) | number | undefined | |
theme (省略可) | "light" | "dark" | undefined |
|
例
import { drawBracket, type BackgroundOptions } from "@johnmorrisdotca/taisen-brackets";
const background: BackgroundOptions = { preset: "aurora", intensity: 0.6, seed: 7 };
console.log(drawBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }, { sides: ["Cascade", "Delta"], score: [0, 1] }, { sides: ["Aurora", "Delta"], score: [3, 1] }], { background }).startsWith("<svg"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。