col_contrast_ratio: Get colors' contrast ratio

Description Usage Arguments Value Examples

Description

Functions to get contrast ratio between two colors.

Usage

1

Arguments

...

colors string, the length of '...' must be 2.

Value

Return the contrast ratio of two colors. For the same colors, return 1. The value increases with the increase of contrast ratio.

Examples

1
2
col_contrast_ratio("red", "white")
col_contrast_ratio("red", "#AB12CD")

houyunhuang/tinycolor documentation built on June 6, 2019, 7:43 p.m.