Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

Color Style

Tonic UI comes with a color style system that defines functional color values (See Color Values section below for details). You can override the default value by creating a color style object in accordance to the color mode, and pass the object to ColorStyleProvider with the value prop. For example:

Then you can use the useColorStyle Hook to get or set color style for a given color mode.

EDITABLE EXAMPLE

Color Values

Dark color style

Light color style

Background
Dark Mode
Primary
gray:100
#151515
Secondary
gray:90
#212121
Tertiary
gray:80
#303030
Inverse
gray:10
#f2f2f2
Light Mode
Primary
white:emphasis
rgba(255, 255, 255, 1.0)
Secondary
gray:10
#f2f2f2
Tertiary
gray:20
#e0e0e0
Inverse
gray:70
#424242
Color
Dark Mode
Emphasis
white:emphasis
rgba(255, 255, 255, 1.0)
Primary
white:primary
rgba(255, 255, 255, .92)
Secondary
white:secondary
rgba(255, 255, 255, .60)
Tertiary
white:tertiary
rgba(255, 255, 255, .47)
Disabled
white:disabled
rgba(255, 255, 255, .28)
Success
green:40
#04c45a
Info
blue:40
#6f9bf4
Warning
orange:50
#ff7633
Error
red:50
#f24c4f
Light Mode
Emphasis
black:emphasis
rgba(0, 0, 0, 1.0)
Primary
black:primary
rgba(0, 0, 0, .92)
Secondary
black:secondary
rgba(0, 0, 0, .65)
Tertiary
black:tertiary
rgba(0, 0, 0, .54)
Disabled
black:disabled
rgba(0, 0, 0, .30)
Success
green:50
#00a94f
Info
blue:60
#1e5ede
Warning
orange:50
#ff7633
Error
red:60
#e52630
Text
Dark Mode
Selection
blue:60
#1e5ede
Highlight
#fce79e
Light Mode
Selection
blue:60
#1e5ede
Highlight
#fce79e
Shadow
Dark Mode
Thin
0 2px 8px 0 rgba(0, 0, 0, 0.48), 0 1px 2px 0 rgba(0, 0, 0, 0.16)
Medium
0 4px 16px 0 rgba(0, 0, 0, 0.48), 0 2px 4px 0 rgba(0, 0, 0, 0.16)
Thick
0 8px 32px 0 rgba(0, 0, 0, 0.48), 0 4px 8px 0 rgba(0, 0, 0, 0.16)
Light Mode
Thin
0 2px 8px 0 rgba(0, 0, 0, 0.16), 0 1px 2px 0 rgba(0, 0, 0, 0.08)
Medium
0 4px 16px 0 rgba(0, 0, 0, 0.16), 0 2px 4px 0 rgba(0, 0, 0, 0.08)
Thick
0 8px 32px 0 rgba(0, 0, 0, 0.16), 0 4px 8px 0 rgba(0, 0, 0, 0.08)
Severity
Dark Mode
Critical
magenta:60
#dc1d68
High
red:50
#f24c4f
Medium
orange:50
#ff7633
Low
yellow:50
#faba2a
Safe
green:40
#04c45a
Info
gray:50
#8a8a8a
Unknown
gray:50
#8a8a8a
Light Mode
Critical
magenta:60
#dc1d68
High
red:60
#e52630
Medium
orange:50
#ff7633
Low
yellow:50
#faba2a
Safe
green:50
#00a94f
Info
gray:50
#8a8a8a
Unknown
gray:50
#8a8a8a
Chart
Dark Mode
0
gray:50
#8a8a8a
1
blue:50
#578aef
2
green:40
#04c45a
3
orange:50
#ff7633
4
cyan:40
#10b4d3
5
red:50
#f24c4f
6
purple:50
#ab6ff3
7
teal:40
#04caa1
8
magenta:40
#f36fa0
9
green:30
#40e884
10
yellow:50
#faba2a
Light Mode
0
gray:50
#8a8a8a
1
blue:60
#1e5ede
2
green:50
#00a94f
3
orange:50
#ff7633
4
cyan:40
#10b4d3
5
red:60
#e52630
6
purple:60
#8f41e9
7
teal:40
#04caa1
8
magenta:50
#e94181
9
green:30
#40e884
10
yellow:50
#faba2a

Gradient Color Values

Gradient color values are not defined in the color style system, you can set gradient with below values when necessary.

Gradient - Severity
High
purple:60
red:50
#8f41e9
#f24c4f
Medium
red:50
orange:50
#f24c4f
#ff7633
Low
orange:50
yellow:50
#ff7633
#faba2a
Safe
teal:50
green:40
#00a584
#04c45a
Gradient - Others
1
purple:50
magenta:40
#ab6ff3
#f36fa0
2
purple:60
blue:50
#8f41e9
#578aef
3
blue:50
teal:40
#578aef
#04caa1
4
cyan:40
teal:30
#10b4d3
#41e9c5
5
blue:60
teal:40
#1e5ede
#04caa1
6
green:40
cyan:30
#04c45a
#41d8e9
7
magenta:60
red:40
#dc1d68
#f46f71
8
magenta:50
blue:60
#e94181
#1e5ede

Blindness Color Values

Blindness color values are not defined in the color style system, you can set blindness with below values when necessary.

Blindness - Severity
High
magenta:60
#dc1d68
Medium
orange:50
#ff7633
Low
yellow:50
#faba2a
Safe
green:30
#40e884
Info
gray:50
#8a8a8a
Unknown
gray:50
#8a8a8a
Blindness - Chart
0
gray:50
#8a8a8a
1
blue:30
#95b7fc
2
green:30
#40e884
3
orange:50
#ff7633
4
cyan:30
#41d8e9
5
magenta:60
#dc1d68
6
purple:50
#ab6ff3
7
teal:40
#04caa1
8
purple:30
#cca6f9
9
cyan:70
#006496
10
yellow:50
#faba2a
Blindness - Gradient
High
purple:60
magenta:60
#8f41e9
#dc1d68
Medium
magenta:60
orange:50
#dc1d68
#ff7633
Low
orange:50
yellow:50
#ff7633
#faba2a
Safe
teal:50
green:30
#00a584
#40e884