颜色转换:HEX、RGB、HSL 在线互转与预览

Color Converter: HEX, RGB, HSL, and Preview

为什么需要颜色互转

网页里颜色写法五花八门:CSS 常用 #336699 十六进制,设计工具习惯 RGB,需要调整亮度或透明度时又得切 HSL。三种写法人人都会遇到,手动换算很麻烦。

这个工具怎么用

打开 颜色转换工具:

  • 输入任意一种格式:十六进制、RGB 或 HSL,填一个即可。
  • 实时互转:另外两种写法自动同步给出,无需任何按钮。
  • 色块预览:转换结果伴随颜色预览,所见即所得。

典型场景

从设计稿里取到一个 #2E7D32,想改成半透明时把透明度换算成 CSS 的 rgba();或者把品牌色转成 HSL 再微调色相找相近色。把网页取色结果贴进来,三种写法一次拿齐。

Why convert between color formats

Colors are written three different ways all the time: CSS leans on hex like #336699, design tools speak RGB, and adjusting brightness or transparency is easiest in HSL. Everyone trips over the conversions.

How the converter works

Open the color converter:

  • Enter any one format — hex, RGB, or HSL; fill in a single field.
  • Convert live — the other two representations appear automatically, no clicks required.
  • Swatch preview — a color chip confirms what you are looking at.

Typical uses

You grab #2E7D32 from a design file and need its rgba() version with transparency, or you want to shift a brand color's hue in HSL to find a near match. Paste your picked color in and get all three flavors at once.

Open the tool打开工具