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

contrastRatiofunction

The contrast between two colours, from 1 (the same) to 21 (black on white).

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

function contrastRatio(a: Parameters<typeof shared.contrastRatio>[0], b: Parameters<typeof shared.contrastRatio>[1]): number

Parameters

NameTypeDescription
aRgb

The first colour, as red, green and blue.

bRgb

The second colour.

Returns

number

The WCAG contrast ratio.

Examples

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

console.log(contrastRatio([255, 255, 255], [0, 0, 0]));
21

What it prints (run when this page was built)

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