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

Background.bg-royal-blue
Text.text-royal-blue
Border.border-royal-blue
Surface.surface-royal-blue

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

Best text color#FFFFFF
Black contrast4.33:1
White contrast4.85:1
RGB token65 105 225

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.

AI-Ready Dataset v1.0.0
Luminance0.1666
Black text4.33:1AA Fail
White text4.85:1AA Pass
cssVariablesReusable CSS custom properties
utilityClassesBackground, text, border, surface, and shadow classes
bestTextColorAccessible default foreground token
contrastBlack and white contrast ratios
wcagAA and AAA text color options
relatedEndpointsLinked machine-readable resources
Download JSON Open API
Structured 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"
}