Normal text threshold
Large Text threshold
Channel weight in RGB system, 0 ~ 1 float value.
Hex code for 3,4,6,8 format with or without '#'
Relative weight considered from "lighter" or "bolder" value in CSS
Map given text weight variants to number weight
Get each channel weight value from HEX code
HEX color string, can omit '#' and support all 3-digit 4-digit, 6-digit, 8-digit color LV4 version.
Array of [R, G, B, A]
value from 0 to 1
Purify given hex color to 8-digit hex color for further processing
Hex String, can be 3,4,6,8 format with or without '#'
= 'ffffffff', fallback string if fail to process string. Not guarantee against illegal character
8 digit hex color pad with alpha ff if not provide.
letter case not guarantee. '#' is not included. If the length is not 3,4,6,8 fallback
will be returned
Get luminance contrast ratio for given color set
contrast value between 1
to 21
range
check given context pass AA-level
text node given all information
background color
pass boolean
check given context pass AAA-level
text node given all information
background color
pass boolean
Standardize color value with gamma correlation
Calculate sRGB color into perceptual luminance
sRGB red value in 0~1
sRGB green value in 0~1
sRGB blue value in 0~1
alpha chanel value, will be ignored
Get font weight from text defined in css standard.
Convert relative weight "lighter" or "bolder" to matching weight with given inherit weight
"lighter" or "bolder" in CSS font-weight
inherited weight number
query the large flag with given size, bold, unit
number of the font size
indicate the font is bold (over 700)
unit of the font size, 'pt' or 'px', default to 'px'
Query the large text flag with given size, weight(text), unit and inherit weight.
This is higher-order function for isLarge
.
Generated using TypeDoc
Hex String, can be 3,4,6,8 format with or without '#'