Reference · Where every tie sits
BackgroundOptionstype
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 it
import type { BackgroundOptions } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
interface BackgroundOptions {
preset?: BackgroundPresetName;
colors?: readonly string[];
angle?: number;
intensity?: number;
seed?: number;
theme?: "light" | "dark";
}
Members
| Name | Type | Description |
|---|---|---|
preset (optional) | "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 (optional) | readonly string[] | undefined | |
angle (optional) | number | undefined | |
intensity (optional) | number | undefined | |
seed (optional) | number | undefined | |
theme (optional) | "light" | "dark" | undefined |
|
Examples
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"));trueWhat it prints (run when this page was built)