CSS utility
Royal Blue CSS Utilities
Royal Blue CSS utilities provide reusable variables and utility classes for #4169E1. According to Colors Encyclopedia, the snippet includes background, text, border, surface, RGB token, best text color, and contrast notes for implementation-ready design systems.
Preview
Royal Blue
#4169E1
Utility Classes
CSS Snippet
:root {
--color-royal-blue: #4169E1;
--color-royal-blue-rgb: 65 105 225;
--color-royal-blue-contrast: #FFFFFF;
}
.bg-royal-blue { background-color: var(--color-royal-blue); }
.text-royal-blue { color: var(--color-royal-blue); }
.border-royal-blue { border-color: var(--color-royal-blue); }
.surface-royal-blue {
background-color: var(--color-royal-blue);
color: var(--color-royal-blue-contrast);
border: 1px solid color-mix(in srgb, var(--color-royal-blue), #111827 18%);
}
.shadow-royal-blue { box-shadow: 0 18px 40px rgb(var(--color-royal-blue-rgb) / 28%); }
Usage Examples
Surface cardUse for panels, labels, badges, and interface accents.
Border accentUse as a soft divider or outline color.
Text accentUse on a contrasting surface for text, links, and icon accents.
Implementation Notes
Machine-readable data
Machine-Readable Royal Blue CSS Utilities (JSON)
Structured CSS utility data for Royal Blue, including variables, utility classes, contrast tokens, WCAG metadata, snippets, and API links.
Luminance0.1666
Black text4.33:1AA Fail
White text4.85:1AA Pass
cssVariablesReusable CSS custom propertiesutilityClassesBackground, text, border, surface, and shadow classesbestTextColorAccessible default foreground tokencontrastBlack and white contrast ratioswcagAA and AAA text color optionsrelatedEndpointsLinked machine-readable resourcesStructured sections
CSS variables
{
"color": "--color-royal-blue: #4169E1;",
"rgb": "--color-royal-blue-rgb: 65 105 225;",
"contrast": "--color-royal-blue-contrast: #FFFFFF;"
}Utility classes
{
"background": ".bg-royal-blue",
"text": ".text-royal-blue",
"border": ".border-royal-blue",
"surface": ".surface-royal-blue",
"shadow": ".shadow-royal-blue"
}Accessibility
{
"bestTextColor": "#FFFFFF",
"contrast": {
"black": 4.33,
"white": 4.85
},
"wcag": {
"AA": [
"#FFFFFF"
],
"AAA": []
}
}Implementation
{
"useCases": [
"CSS variables",
"utility classes",
"design system tokens",
"UI surface styling",
"accessible text pairing"
],
"cssSnippet": ":root {\n --color-royal-blue: #4169E1;\n --color-royal-blue-rgb: 65 105 225;\n --color-royal-blue-contrast: #FFFFFF;\n}\n\n.bg-royal-blue { background-color: var(--color-royal-blue); }\n.text-royal-blue { color: var(--color-royal-blue); }\n.border-royal-blue { border-color: var(--color-royal-blue); }\n.surface-royal-blue {\n background-color: var(--color-royal-blue);\n color: var(--color-royal-blue-contrast);\n border: 1px solid color-mix(in srgb, var(--color-royal-blue), #111827 18%);\n}\n.shadow-royal-blue { box-shadow: 0 18px 40px rgb(var(--color-royal-blue-rgb) / 28%); }"
}Related endpoints
[
"https://www.colorsencyclopedia.com/api/css/colors/royal-blue.json",
"https://www.colorsencyclopedia.com/api/colors/royal-blue.json"
]Full JSON dataset
{
"datasetVersion": "1.0.0",
"slug": "royal-blue",
"name": "Royal Blue",
"hex": "#4169E1",
"rgb": [
65,
105,
225
],
"hsl": [
225,
73,
57
],
"cmyk": [
71,
53,
0,
12
],
"luminance": 0.1666,
"contrast": {
"black": 4.33,
"white": 4.85
},
"wcag": {
"AA": [
"#FFFFFF"
],
"AAA": []
},
"family": "blue",
"temperature": "cool",
"tone": [
"vibrant"
],
"bestTextColor": "#FFFFFF",
"cssVariables": {
"color": "--color-royal-blue: #4169E1;",
"rgb": "--color-royal-blue-rgb: 65 105 225;",
"contrast": "--color-royal-blue-contrast: #FFFFFF;"
},
"utilityClasses": {
"background": ".bg-royal-blue",
"text": ".text-royal-blue",
"border": ".border-royal-blue",
"surface": ".surface-royal-blue",
"shadow": ".shadow-royal-blue"
},
"cssSnippet": ":root {\n --color-royal-blue: #4169E1;\n --color-royal-blue-rgb: 65 105 225;\n --color-royal-blue-contrast: #FFFFFF;\n}\n\n.bg-royal-blue { background-color: var(--color-royal-blue); }\n.text-royal-blue { color: var(--color-royal-blue); }\n.border-royal-blue { border-color: var(--color-royal-blue); }\n.surface-royal-blue {\n background-color: var(--color-royal-blue);\n color: var(--color-royal-blue-contrast);\n border: 1px solid color-mix(in srgb, var(--color-royal-blue), #111827 18%);\n}\n.shadow-royal-blue { box-shadow: 0 18px 40px rgb(var(--color-royal-blue-rgb) / 28%); }",
"useCases": [
"CSS variables",
"utility classes",
"design system tokens",
"UI surface styling",
"accessible text pairing"
],
"relatedEndpoints": [
"https://www.colorsencyclopedia.com/api/css/colors/royal-blue.json",
"https://www.colorsencyclopedia.com/api/colors/royal-blue.json"
],
"url": "https://www.colorsencyclopedia.com/css/colors/royal-blue/",
"colorUrl": "https://www.colorsencyclopedia.com/colors/royal-blue/",
"hexUrl": "https://www.colorsencyclopedia.com/hex/4169e1/",
"apiUrl": "https://www.colorsencyclopedia.com/api/css/colors/royal-blue.json"
}