// DEV / COLOR
颜色转换Color Converter
HEX、RGB、HSL 实时互转,带透明度与明暗对比度参考。Convert between HEX, RGB and HSL with alpha and contrast ratio reference.
透明度Alpha100%
HEXHEX#22d3ee
RGBRGBrgb(34, 211, 238)
HSLHSLhsl(188, 86%, 53%)
WCAG 对比度WCAG contrast正文要求:AA ≥ 4.5,AAA ≥ 7Body text: AA ≥ 4.5, AAA ≥ 7
与白色对比Against white
1.81:1AAAAA
与黑色对比Against black
11.62:1AAAAA
常见问题FAQ
颜色转换支持哪些输入写法?Which color formats are accepted?
支持 HEX(#rgb、#rgba、#rrggbb、#rrggbbaa,可省略 #)以及 rgb()、rgba()、hsl()、hsla(),并可在 HEX、RGB、HSL 之间实时互转。HEX in the forms #rgb, #rgba, #rrggbb and #rrggbbaa with the # optional, plus rgb(), rgba(), hsl() and hsla(). Values convert between HEX, RGB and HSL as you type.
对比度是怎么算的?How is the contrast ratio calculated?
按 WCAG 公式计算与白色、黑色的对比度,并标注是否达到 AA(4.5:1)与 AAA(7:1)。半透明颜色会先与底色混合再计算。Contrast against white and black follows the WCAG formula and is marked against AA at 4.5 to 1 and AAA at 7 to 1. Semi-transparent colors are blended with the background before measuring.
同类工具Related tools
- JSON 格式化JSON Formatter
- JSON 校验JSON Validator
- JSON 对比JSON Diff
- YAML / JSON 互转YAML ↔ JSON
- Base64 编解码Base64 Encode / Decode
- Unicode 编解码Unicode Encoder
- URL 编解码URL Encode / Decode
- URL 解析URL Parser
- 哈希生成Hash Generator
- 正则测试Regex Tester
- 密码强度检测Password Checker
- 随机密码Password Generator
- User Agent 解析User Agent Parser
- UUID 生成UUID Generator
- 时间戳转换Timestamp Converter