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 · Backgrounds for a bracket

parseColorfunction

Reads a colour written as #rgb, #rrggbb or rgb(…).

Import it

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

Definition

function parseColor(text: string): ReturnType<typeof shared.parseColor>

Parameters

NameTypeDescription
textstring

The colour as text.

Returns

Rgb | null

The red, green and blue, 0 to 255; null when the text is not a colour.

Examples

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

console.log(parseColor("#2f5d4a"), parseColor("not a colour"));
[ 47, 93, 74 ] null

What it prints (run when this page was built)

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