logo
GeekFormat

Color Converter

最接近的 CSS 颜色名: mediumseagreen

RGB

R
G
B
A

HSL

H
S
L

HSV

H
S
V
HEX#22c55e
RGBrgb(34, 197, 94)
RGBArgba(34, 197, 94, 1)
HSLhsl(142, 71%, 45%)
HSLAhsla(142, 71%, 45%, 1)
HSVhsv(142, 83%, 77%)
HWBhwb(142, 13%, 23%)
CMYKcmyk(83%, 0%, 52%, 23%)
XYZxyz(22.64, 41.08, 17.32)
LABlab(70, -62, 40)
LCHlch(70, 74, 147)
OKLABoklab(1, 0, 0)
OKLCHoklch(1, 0, 180)

WCAG 对比度检查

白字
2.28:1
AA AAA
黑字
9.22:1
AA AAA

Online color converter supporting one-click conversion between 14 color formats including HEX, RGB, RGBA, HSL, HSLA, HSV, HWB, CMYK, XYZ, LAB, LCH, OKLAB, and OKLCH. Features built-in color picker for real-time adjustments, WCAG contrast checking, color harmony schemes, shade generation, batch conversion, and image color extraction. All calculations run entirely in your browser locally—no file uploads needed, perfect for designers and frontend developers.

Related

Use Cases

  • Converting HEX values from design mockups to RGB/HSL for CSS styles in frontend development, or to RGBA when transparency is needed
  • Unifying color value formats when switching between design tools like Figma, Sketch, and Photoshop for UI/UX designers
  • Converting screen RGB values to CMYK for reference during early print production communication
  • Checking contrast ratios between text and background colors for WCAG AA/AAA compliance in accessible design
  • Quickly generating a complete tint-to-shade family for building design systems using the shade generator
  • Generating professional color schemes (complementary, analogous, etc.) for branding or poster design using color harmony
  • Extracting dominant colors from reference images or photos for inspiration (image color picker)
  • Batch processing multiple color values from design mockups and converting to needed formats at once
  • Conveniently adjusting brightness and saturation with HSL or OKLCH when writing CSS states like hover
  • Building perceptually uniform design system colors using modern CSS OKLCH color space
  • Teaching color space principles with interactive visual comparison of how different formats represent the same color
  • Quickly finding the English CSS named color for any value for easy reference and communication

Features

  • 14 color format conversions: Support for HEX, RGB, RGBA, HSL, HSLA, HSV, HWB, CMYK, XYZ, LAB, LCH, OKLAB, OKLCH, and CSS named colors
  • Smart input recognition: Paste any color format and it auto-detects; supports shorthand #rgb, #rrggbbaa with alpha, rgb(), hsl(), and CSS color names
  • Real-time slider adjustments: RGB red/green/blue, HSL hue/saturation/lightness, HSV sliders for instant WYSIWYG color tuning
  • Alpha transparency support: RGBA and HSLA conversion with alpha channel, supporting both percentage and decimal opacity formats
  • CSS color name matching: Automatically finds the closest standard CSS named color (140+ options) for quick reference
  • WCAG contrast checker: Real-time calculation of contrast ratios against white and black text, with automatic AA (≥4.5:1) and AAA (≥7:1) pass/fail indicators
  • Color harmony generator: One-click generation of 5 classic schemes—complementary, analogous, triadic, split-complementary, and tetradic
  • Shade generation: Both traditional RGB-mixed shades and perceptually uniform OKLCH shades available, generating 11 lightness steps instantly
  • Batch conversion: Process multiple color values at once with multi-line input—ideal for processing design system palettes
  • Image color picker: Upload an image to automatically sample and extract 16 dominant colors, great for pulling palettes from references or photos
  • One-click copy: Copy button next to every color format for instant copying in standard notation—ready to paste directly into CSS or design software
  • Random color generator: Generate random colors with one click for quick inspiration
  • Pure browser-based processing: All color calculations run locally in your browser with no server uploads—works instantly with no registration required
  • Responsive design: Works seamlessly on desktop, mobile, and tablet devices—tune colors and copy values comfortably on phones

How to Use

  1. Enter any color format value in the top input box, click the color swatch to use the picker, or drag RGB/HSL/HSV sliders to adjust
  2. The tool automatically converts in real-time to all 14 formats including HEX, RGB, RGBA, HSL, HSV, CMYK, OKLCH
  3. Switch to 'Color Harmony' for schemes, 'Shades' for tint/shade ramps, or 'Batch/Picker' for batch conversion or image color extraction
  4. Click the copy button next to any color format to copy the standard notation directly for use

FAQ

What color formats does the color converter support?

It supports conversion between 14 common color formats: HEX (3-digit shorthand and 8-digit with alpha), RGB, RGBA, HSL, HSLA, HSV, HWB, CMYK, XYZ (CIE 1931 with D65 illuminant), CIE LAB, LCH, OKLAB, OKLCH, plus 140+ standard CSS named colors. Enter any format to convert automatically to all others.

How do I use this color conversion tool?

It's very simple: 1) Enter any color value in the top input box—for example #22c55e, rgb(34,197,94), hsl(142,71%,45%), or even a color name like green; 2) Or click the color swatch to use the picker, or drag RGB/HSL/HSV sliders for real-time adjustment; 3) All 14 format conversions appear instantly below—click the copy button next to any format to copy it to your clipboard.

What's the difference between HEX, RGB, and HSL? Where are each used?

HEX is the most common hexadecimal notation for the web—#ff0000 for red—widely used in CSS and design handoff files. RGB represents colors with 0-255 values for red, green, and blue, the foundation of screen displays. HSL uses Hue (0-360°), Saturation, and Lightness, which aligns better with human color perception and is more intuitive for designers to adjust colors. CMYK uses percentages of cyan, magenta, yellow, and black ink for print. OKLCH is a modern perceptually uniform color space that produces visually smooth gradients and shade ramps.

What is WCAG contrast ratio? What ratio meets accessibility standards?

WCAG contrast ratio measures the luminance difference between text color and background color, ensuring content is readable for users with visual impairments. According to Web Content Accessibility Guidelines: normal body text needs ≥4.5:1 for Level AA (passing) and ≥7:1 for Level AAA (excellent); large text (≥18pt bold or ≥24pt regular) needs ≥3:1 for AA. The tool displays real-time contrast ratios against both white and black text, with automatic pass/fail indicators for AA and AAA standards.

What does the A in RGBA mean? How do I set transparency?

The A in RGBA stands for Alpha channel, which controls transparency—values range from 0 (fully transparent) to 1 (fully opaque). For example, rgba(34,197,94,0.5) is semi-transparent green. Adjust transparency with the Alpha slider; conversion results show both RGBA and HSLA formats with alpha. HEX also supports transparency by adding two hex digits after the 6-digit color—for example #22c55e80 represents 50% opacity.

What are OKLCH and LCH? How do they differ from HSL?

LCH and OKLCH are perceptually uniform color spaces where L is Lightness, C is Chroma (saturation), and H is Hue. Their biggest advantage over HSL is: colors with the same L value actually appear equally bright visually, which is critical for design systems—if you generate palettes with different hues but the same lightness using HSL, some appear darker than others, but OKLCH guarantees uniform perceived lightness. OKLCH is newer than LAB/LCH with simpler calculations and more accurate color prediction, recommended in modern CSS (CSS Color Level 4).

How do I use the image color picker feature?

Switch to the 'Batch/Picker' tab, click upload to select an image—the tool automatically scales images to a 100×100 grid and extracts 16 colors from evenly distributed positions, showing swatches and color values. Click any swatch to set that color as your main color for further adjustment and conversion. Perfect for quickly extracting palettes from reference images, design mockups, or photos.

What color harmony schemes are available and how do I use them?

The tool provides 5 classic harmony schemes: 1) Complementary: Colors 180° apart for high contrast; 2) Analogous: Colors 30° apart for natural harmony; 3) Triadic: Colors 120° apart for vibrant balance; 4) Split-complementary: Base color + 30° either side of complement for contrast with softness; 5) Tetradic (rectangle): Four colors 90° apart for rich variety. Switch to the 'Color Harmony' tab to see generated schemes—click any swatch to set it as your main color.

Can CMYK conversion results be used directly for print?

They work well as a reference, but note: screens use additive RGB color (light emission), while print uses subtractive CMYK (ink reflection). These have different gamuts—some bright RGB colors (like vivid greens and blues) cannot be accurately reproduced with CMYK inks, so some color shift occurs. The tool uses standard RGB-to-CMYK conversion formulas, suitable for early communication and quick reference. For final print production, we recommend using professional design software with proper ICC color profiles for soft proofing.

How does batch conversion work? How many colors can I convert at once?

Switch to the 'Batch/Picker' tab, enter one color per line in the text box (mixing HEX/RGB/HSL/CSS color names freely), then click batch convert to process all colors at once. Results show color swatches and HEX values for each. There's no theoretical limit, but for hundreds of colors we recommend processing in batches to avoid browser lag.

Can I use the color converter on mobile?

Yes. The tool uses responsive design and works perfectly on mobile, tablet, and desktop screens of all sizes. On mobile you can still enter color values, drag sliders to adjust colors, view conversions, and copy values—all features match the desktop experience. And since it's pure local computation, it won't use your mobile data.

What if the input says 'unrecognized color format'?

Check the input format: 1) HEX must start with # (optional) followed by 3, 6, or 8 hex characters (0-9/a-f)—#f00, #ff0000, #ff0000ff are all valid; 2) RGB format must be rgb(r,g,b) with three values 0-255 separated by commas; 3) HSL format is hsl(h,s%,l%) with hue 0-360°, saturation and lightness 0-100%; 4) CSS color names must be standard names like red/blue/green—Chinese color names are not supported.

Why do converted colors look different in different software?

This is normal color management behavior: different software, monitors, and operating systems may use different color profiles (sRGB, Display P3, Adobe RGB), causing slight visual differences for the same color value. Web pages default to the sRGB color space—if you're using Adobe RGB or Display P3 profiles in software like Photoshop, you'll need to convert to sRGB when exporting for consistent web display.

Which color format should I use in frontend development?

Modern CSS supports all color formats: HEX is most common with best compatibility and is the standard for design handoff; RGB/RGBA works well when you need dynamic opacity adjustments or channel-level manipulation; HSL is most intuitive for writing color variants directly in code (like lightening a hover state by just increasing L); OKLCH is the future, natively supported in CSS Color Level 4, with perceptual uniformity perfect for generating shades and gradients—choose based on your project's compatibility needs.

What's the shade generation feature for? What's the difference between traditional and OKLCH shades?

Shade generation instantly creates 11 steps (50-900) of tints and shades for a color family, ideal for building design system palettes (like Tailwind's color system). Traditional shades simply mix toward white in RGB space—while numerically uniform, the middle tones can look uneven. OKLCH shades maintain hue and chroma while only adjusting lightness L, producing visually smooth transitions between light and dark—more professional and polished.

About Color Spaces and Color Format Conversion

Color converters are among the most frequently used tools for designers and frontend developers, providing accurate conversion between different color representations. Color itself is a visual perception; to represent it on computers and in print, people have developed multiple color models (color spaces) that describe the same color using different numerical systems, each suited to different scenarios and devices.

Common color formats include: HEX (hexadecimal RGB, the standard web notation), RGB (Red/Green/Blue values 0-255, the foundation of screen displays), HSL (Hue/Saturation/Lightness, most intuitive for human color adjustment), CMYK (Cyan/Magenta/Yellow/Key Black percentages for print). In recent years perceptually uniform color spaces like OKLCH have grown in popularity because they mathematically guarantee that colors with the same lightness value actually appear equally bright visually—critical for building design systems and generating gradients.

Why convert between color formats? Different tools, platforms, and output media use different color formats: web CSS supports HEX/RGB/HSL/OKLCH and more; design software like Figma/Sketch defaults to HEX; print requires CMYK; and when dynamically adjusting colors in code (like hover states or opacity changes), HSL and OKLCH are far more convenient than HEX. Accurate color conversion ensures color consistency between design mockups and final implementation.

WCAG contrast is an important standard for web accessibility, measuring luminance difference between foreground text and background colors to ensure readability for users with visual impairments. Normal body text needs a 4.5:1 contrast ratio (AA level), with important content recommended at 7:1 (AAA level). Our tool calculates this in real time, helping designers consider accessibility during color selection rather than remediating later.

Color Harmony is a classic color theory based on the color wheel, generating visually cohesive combinations using geometric positions of hues around the wheel. Complementary colors create strong contrast ideal for buttons and accents; analogous colors are harmonious and natural for large background areas; triadic and tetradic schemes offer balance and richness for brand identity. The tool includes 5 of the most commonly used harmony schemes, generating palettes with one click.

Color Shades/Tints are light-to-dark variations of the same hue, the foundation for building design systems (like Tailwind CSS's 50-900 palettes). Traditional RGB shades simply mix toward white, but appear visually uneven; OKLCH-based shades maintain hue and chroma while only adjusting lightness, producing visually smooth light-to-dark transitions—the recommended approach for modern design systems. Our tool offers both shade styles for comparison.

Why does local processing matter? Color conversion is purely mathematical and requires absolutely no data upload to servers. All calculations in our tool run entirely in your browser locally—open the page and use it instantly with no registration or login, no image or color data uploaded. It's fast and privacy-preserving—you can confidently use it even for unreleased, confidential design mockup colors.

Important note: Color format conversion is mathematically precise, but due to screen gamuts, monitor calibration, and printing processes, the same color value may appear slightly different across devices and media. Screens use additive RGB (more light = brighter), while print uses subtractive CMYK (more ink = darker). The two have different gamuts—some highly saturated RGB colors cannot be accurately reproduced with CMYK inks. Conversion results are ideal for digital design and web development; for final print production, we recommend professional color management software for proofing.

术语表

HEX
Hexadecimal color notation using # followed by 6 hex digits representing RGB (two digits per channel, 00-FF)—#FF0000 for red, the most common format for web and design software. Supports 3-digit shorthand (e.g. #f00) and 8-digit notation with alpha.
RGB/RGBA
Represents color with three values 0-255 for Red, Green, and Blue; rgba() adds an Alpha channel for transparency (0-1). The foundational color model for screen displays.
HSL/HSLA
Represents color with Hue (0-360°), Saturation (0-100%), and Lightness (0-100%), aligning better with human color perception—more intuitive for designers adjusting colors.
HSV/HSB
Hue, Saturation, Value/Brightness—similar to HSL but with different lightness calculation, commonly found in color pickers in design software like Photoshop.
HWB
Hue, Whiteness, Blackness—a CSS Color Level 4 addition that's more intuitive than HSL: simply add white or black to adjust the tone.
CMYK
Percentages of Cyan, Magenta, Yellow, and Key (Black) inks, used in the printing industry to represent ink mixture ratios.
CIE LAB/LAB
A perceptually uniform color space defined by the International Commission on Illumination (CIE): L for Lightness (0-100), a for green-red axis, b for blue-yellow axis—designed so numerical distances correspond to perceived color differences.
LCH
A polar coordinate representation converted from LAB: L Lightness, C Chroma (saturation), H Hue—more perceptually uniform than HSL, suitable for professional design requiring precise perceptual control.
OKLAB/OKLCH
A new generation of perceptually uniform color spaces introduced in 2020—simpler calculations and more accurate hue prediction than LAB/LCH. OKLCH is its polar form, natively supported in modern CSS and recommended for building design systems.
WCAG Contrast
The luminance ratio between foreground text and background specified by the Web Content Accessibility Guidelines: AA requires ≥4.5:1 for body text, AAA requires ≥7:1—ensuring readability for users with visual impairments.
Color Harmony
Color theory based on positions around the color wheel, using geometric relationships (complementary 180°, analogous 30° spacing, triadic 120° spacing, etc.) to generate visually cohesive and aesthetically pleasing combinations.
Shades/Tints
A range of light-to-dark variations of the same hue, typically generated as 11 steps from 50 to 900, used in design systems for different applications of a single color (backgrounds, borders, text, accents).

14 Color Formats Comparison Quick Reference

Below are the value ranges, pure red examples, and primary use cases for each color format:

FormatValue RangePure Red ExamplePrimary Use Cases
HEX#RRGGBB 00-FF#ff0000Web CSS, design handoff—the most universal format
RGBR/G/B: 0-255rgb(255,0,0)Screen display foundation, Canvas/WebGL programming
RGBAPlus A: 0-1rgba(255,0,0,1)CSS requiring transparency, overlay effects
HSLH:0-360°, S/L:0-100%hsl(0,100%,50%)Designer color adjustment, dynamic color manipulation in code
HSVH:0-360°, S/V:0-100%hsv(0,100%,100%)Design software color pickers like Photoshop
HWBH:0-360°, W/B:0-100%hwb(0,0%,0%)CSS Color 4—intuitive adjustment by adding white/black
CMYKC/M/Y/K: 0-100%cmyk(0%,100%,100%,0%)Print and publishing industry
OKLCHL:0-1, C:0-0.4, H:0-360°oklch(0.63,0.24,29)Modern CSS, design system palettes, perceptually uniform gradients

WCAG Accessibility Contrast Standards Reference

Minimum contrast requirements from Web Content Accessibility Guidelines (WCAG 2.1):

LevelContrast Ratio RequirementApplicable Text TypeNotes
AA≥ 4.5:1Normal body text (<18pt regular or <14pt bold)Minimum passing standard, legal compliance requirement
AA≥ 3:1Large text (≥18pt regular or ≥14pt bold)Large headings may have reduced requirements
AAA≥ 7:1Normal body text (enhanced)Recommended for important content, long-form reading
AAA≥ 4.5:1Large text (enhanced)Excellent accessible design

5 Color Harmony Schemes Quick Reference

Classic color combinations based on hue wheel angles—click to generate instantly:

Scheme TypeHue SpacingColor CountVisual Effect & Use Cases
Complementary180° apart2 colorsStrong contrast—ideal for buttons, accents, CTAs
Analogous±30° adjacent3 colorsHarmonious and natural—great for large backgrounds, primary palettes
Triadic120° spacing3 colorsVibrant and balanced—ideal for branding, illustration
Split-ComplementaryBase + ±30° of complement3 colorsContrast with softness—more refined than complementary
Tetradic90° spacing4 colorsRich and varied—ideal for complex designs, children's products

Privacy & Security

This color converter runs all color calculations, image color picking, and batch processing entirely locally in your browser using pure JavaScript in browser memory. The color values you enter and images you upload are never transmitted over the network to any server, nor logged, cached, or stored. After processing, closing or refreshing the page automatically clears temporary data from browser memory. Sensitive content like unreleased design mockup colors and brand colors can be used safely with no risk of leakage.

Authoritative References

Troubleshooting

What if input shows 'unrecognized color format'?

Check: 1) HEX format uses valid hex characters (0-9, a-f, A-F) with 3, 6, or 8 digits; # is optional; 2) RGB/RGBA format requires three or four values in parentheses—R/G/B 0-255, Alpha 0-1, separated by commas; 3) HSL/HSLA format requires H 0-360, S and L as 0-100 percentage values; 4) CSS color names must be standard English names—Chinese color names are not supported.

Why does CMYK conversion look different from actual print?

This is expected: RGB and CMYK have different gamuts—many bright RGB colors cannot be reproduced with CMYK inks. The tool uses standard conversion formulas suitable for early reference. For professional print: 1) Convert to CMYK mode in design software; 2) Use correct ICC color profiles; 3) Perform a digital proof.

Why does the same color look different on my phone vs. computer?

Different screens have different gamut coverage, color temperature, brightness, and calibration: Mac defaults to Display P3 wide gamut, most Windows PCs use sRGB, and mobile screens vary. Web design is recommended to standardize on sRGB as a baseline for consistent appearance across most devices.

Uploading image for color picker doesn't respond?

Please confirm: 1) You're uploading a standard image format (JPG/PNG/GIF/WebP); 2) The image file is not corrupted; 3) File size is not too large (recommend under 5MB). Image color picking processes locally in canvas and is never uploaded to servers—refreshing and re-uploading usually resolves issues.