Color syntax

Color is a complex type spanning one or more values.

Syntax

Class
Properties
{scaleName}
{...}
{scaleName}-{shade}
{...}
{scaleName}-{shade}-{opacity}
{...}
{pointName}
{...}
{pointName}-{opacity}
{...}
transparent
transparent
current
currentColor
hex-{rgb}
#{rgb}
hex-{rgba}
#{rgba}
hex-{rrggbb}
#{rrggbb}
hex-{rrggbbaa}
#{rrggbbaa}
rgb-{r}-{g}-{b}
rgb({r}, {g}, {b})
rgb-{r}-{g}-{b}-{a}
rgba({r}, {g}, {b}, {a})
hsl-{h}-{s}-{l}
hsl({h}, {s}, {l})
hsl-{h}-{s}-{l}-{a}
hsla({h}, {s}, {l}, {a})

Parameters

scaleName
<string>

Name of the color scale. See definitions below.

shade
<uint32>

Defaults to 500.

opacity
<uint32>

Unit: %. Defaults to 100%.

pointName
black | white | <string>

Name of the color point. See definitions below.

rgb
<hexColor>

Without the hash mark, for example ABC.

rgba
<hexColor>

Without the hash mark, for example ABCD.

rrggbb
<hexColor>

Without the hash mark, for example ABCDEF.

rrggbbaa
<hexColor>

Without the hash mark, for example ABCDEF12.

r
<uint8>

Red color code between 0-255.

g
<uint8>

Green color code between 0-255.

b
<uint8>

Blue color code between 0-255.

h
<int32>

Hue. Unit: deg.

s
<uint8>

Saturation value between 0-100. Unit: %.

l
<uint8>

Lightness value between 0-100. Unit: %.

a
<uint8>

Alpha value between 0-100. Unit: %.

<div class="t1 mb-8">Identical colors (500 is the default shade)</div> <div class="t1 flex @/w-32 @/h-32 @/shadow-2-inset @/rounded-full @/m-4"> <div class="t1 bg-c-blue"></div> <div class="t1 bg-c-blue-500"></div> </div>
<div class="t1 flex flex-wrap @/w-32 @/h-32 @/shadow-2-inset @/rounded-full @/m-4"> <div class="t1 bg-c-blue-50"></div> <div class="t1 bg-c-blue-100"></div> <div class="t1 bg-c-blue-150"></div> <div class="t1 bg-c-blue-200"></div> <div class="t1 bg-c-blue-250"></div> <div class="t1 bg-c-blue-300"></div> <div class="t1 bg-c-blue-350"></div> <div class="t1 bg-c-blue-400"></div> <div class="t1 bg-c-blue-450"></div> <div class="t1 bg-c-blue-500"></div> </div>
<div class="t1 flex @/w-32 @/h-32 @/shadow-2-inset @/rounded-full @/m-4"> <div class="t1 bg-c-blue-500"></div> <div class="t1 bg-c-blue-500-80"></div> <div class="t1 bg-c-blue-500-60"></div> <div class="t1 bg-c-blue-500-40"></div> <div class="t1 bg-c-blue-500-20"></div> <div class="t1 bg-c-blue-500-0"></div> </div>
<div class="t1 flex @/w-32 @/h-32 @/shadow-2-inset @/rounded-full @/m-4"> <div class="t1 bg-c-text"></div> <div class="t1 bg-c-heading"></div> <div class="t1 bg-c-link"></div> <div class="t1 bg-c-linkVisited"></div> </div>
<div class="t1 flex @/w-32 @/h-32 @/shadow-2-inset @/rounded-full @/m-4"> <div class="t1 bg-c-text-30"></div> <div class="t1 bg-c-heading-30"></div> <div class="t1 bg-c-link-30"></div> <div class="t1 bg-c-linkVisited-30"></div> </div>
<div class="t1 color-blue"> <div class="t1 bg-c-current w-32 h-32 shadow-2-inset rounded-full"></div> </div>
<div class="t1 bg-c-transparent w-32 h-32 shadow-2-80-inset rounded-full"></div>
<div class="t1 flex flex-wrap @/w-32 @/h-32 @/shadow-2-inset @/rounded-full @/m-4"> <div class="t1 bg-c-hex-1AE"></div> <div class="t1 bg-c-hex-1AE8"></div> <div class="t1 bg-c-hex-12A4E2"></div> <div class="t1 bg-c-hex-12A4E280"></div> <div class="t1 bg-c-rgb-18-164-226"></div> <div class="t1 bg-c-rgb-18-164-226-128"></div> <div class="t1 bg-c-hsl-198-85-48"></div> <div class="t1 bg-c-hsl-198-85-48-50"></div> </div>