Overview
Vuetify provides comprehensive color utilities for parsing, converting, manipulating, and analyzing colors across different formats (RGB, HSV, HSL, Hex).Import
Color Types
Color Parsing
parseColor()
Parse any color format into RGB.Color Conversion
RGBtoHex()
Convert RGB to hexadecimal string.HexToRGB()
Convert hexadecimal string to RGB.HSVtoRGB()
Convert HSV to RGB.RGBtoHSV()
Convert RGB to HSV.HSLtoRGB()
Convert HSL to RGB.HSVtoHSL()
Convert HSV to HSL.HSLtoHSV()
Convert HSL to HSV.Color Manipulation
lighten()
Lighten a color by specified amount.color- RGB color to lightenamount- Amount to lighten (0-10, affects CIELAB L* by amount * 10)
darken()
Darken a color by specified amount.color- RGB color to darkenamount- Amount to darken (0-10, affects CIELAB L* by amount * 10)
Color Analysis
getLuma()
Calculate relative luminance of a color (0-1).getContrast()
Calculate contrast ratio between two colors (1-21).hasLightForeground()
Determine if a color should use light or dark text.Color Palette
Material Design Colors
Available Colors
redpinkpurpledeepPurpleindigobluelightBluecyantealgreenlightGreenlimeyellowamberorangedeepOrangebrownblueGreygreyshades(black, white, transparent)
Shades
Each color (except brown, grey, shades) has:base- Base colorlighten5tolighten1- Lighter shadesdarken1todarken4- Darker shadesaccent1toaccent4- Accent shades
Usage Examples
Theme Color Generation
Contrast Checker
Auto Text Color
Color Palette Component
Dynamic Theme
Notes
- All RGB values are 0-255
- HSV/HSL hue is 0-360 degrees
- HSV/HSL saturation and value/lightness are 0-1
- Alpha channel is 0-1
- Lighten/darken use CIELAB color space for perceptually uniform results
- Contrast ratio follows WCAG 2.0 guidelines
- Material Design colors are pre-defined constants