CalKit

Color Converter

Convert between HEX, RGB, and HSL color codes.

색상 코드

HEX#3B82F6
RGBrgb(59, 130, 246)
HSLhsl(217, 91%, 60%)
R59
G130
B246
H (색상)217°
S (채도)91%
L (명도)60%

Overview

A tool for converting between color code formats including HEX, RGB, and HSL. Quickly transform color values needed for web design, app development, and graphic work.

Formula

HEX to RGB: Convert each pair of hex digits to decimal (e.g., #FF8800 → R=255, G=136, B=0). RGB to HSL: Normalize R, G, B to 0–1, find max and min, then H = hue angle (0–360), S = (max−min)/(1−|2L−1|), L = (max+min)/2. HSL to RGB: Divide H into 60° sectors, calculate C = (1−|2L−1|)×S, X = C×(1−|H/60 mod 2 − 1|), map to RGB, then add m = L − C/2.

How to Use

  1. 1Select the color format you want to convert (HEX, RGB, or HSL).
  2. 2Enter the color value (e.g., #3498DB or R:52 G:152 B:219).
  3. 3The converted values in other formats are displayed automatically.
  4. 4Copy the desired color code for use in your project.

Tips

  • HEX codes can be written in 6-digit or 3-digit shorthand with a '#' prefix.
  • RGB values range from 0 to 255 for each channel.
  • HSL uses H (0–360°), S (0–100%), and L (0–100%).
  • Use rgba() in CSS to specify transparency (alpha channel) along with color.
  • HSL is great for building design systems since adjusting brightness and saturation is intuitive.

FAQ

Q. What is the difference between HEX and RGB?

HEX uses hexadecimal notation (e.g., #FF0000), while RGB uses decimal notation (e.g., 255,0,0). Both represent the intensity of red, green, and blue channels and have the same color range.

Q. What are the advantages of the HSL color model?

HSL stands for Hue, Saturation, and Lightness, which closely matches human color perception. It makes it easy to create consistent palettes by adjusting only the lightness or saturation while keeping the same hue.

Q. Is there any precision loss during color conversion?

Conversion between HEX and RGB is lossless. However, HSL conversion may introduce minor rounding differences. In most cases, these differences are imperceptible to the human eye.

Related Calculators