首页Home › 颜色工具Color Tools

🎨 RGB 转 HEXRGB to HEX Converter

把 RGB 颜色值转换为 HEX 代码:支持 255, 87, 51、rgb()/rgba()、CSS4 空格写法和百分比,含透明度时输出 8 位 HEX,可大写、可缩写。Convert RGB color values to HEX: accepts 255, 87, 51, rgb()/rgba(), CSS4 space syntax and percentages; alpha gives 8-digit HEX, with uppercase and shorthand options.

使用说明与常见问题How-to & FAQ

「RGB 转 HEX」是什么?What is the RGB to HEX Converter tool?

把 RGB 颜色值转换为 HEX 代码:支持 255, 87, 51、rgb()/rgba()、CSS4 空格写法和百分比,含透明度时输出 8 位 HEX,可大写、可缩写。Convert RGB color values to HEX: accepts 255, 87, 51, rgb()/rgba(), CSS4 space syntax and percentages; alpha gives 8-digit HEX, with uppercase and shorthand options.

如何使用「RGB 转 HEX」?How do I use the RGB to HEX Converter tool?

在「RGB 转 HEX」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「255, 87, 51」,得到「#FF5733」。In the RGB to HEX Converter: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it. Example: "255, 87, 51" → "#FF5733".

RGB 怎么换算成 HEX?How is RGB converted to HEX?

把红、绿、蓝每个 0–255 的值转成两位十六进制再拼起来,例如 255 → FF、87 → 57、51 → 33,得到 #FF5733。Convert each 0–255 channel to two hex digits and join them: 255 → FF, 87 → 57, 51 → 33, giving #FF5733.

透明度怎么处理?How is alpha handled?

rgba 的第 4 个值(0–1 或百分比)会转成第 7–8 位,例如 0.5 → 80,得到 8 位 HEX;完全不透明时默认省略。The 4th rgba value (0–1 or a percentage) becomes digits 7–8, e.g. 0.5 → 80, for an 8-digit HEX; it is omitted when fully opaque unless you choose to keep it.

结果可以直接用在 CSS 里吗?Can I paste the results into CSS?

可以。「RGB 转 HEX」输出的是标准 CSS 颜色写法,可直接复制使用;可接受的输入格式以输入框旁的说明为准。Yes. The RGB to HEX Converter outputs standard CSS color notation you can copy straight into a stylesheet; accepted input formats are listed next to the input.

「RGB 转 HEX」免费吗?需要注册吗?Is the RGB to HEX Converter free? Do I need an account?

「RGB 转 HEX」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The RGB to HEX Converter is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

🎨 颜色转换器Color Converter (HEX/RGB/HSL)🌓 颜色对比度检测Color Contrast Checker (WCAG)🌈 颜色深浅色阶生成Color Shades & Tints Generator🎨 配色方案生成器Color Palette Generator🎲 随机颜色生成器Random Color Generator🧪 颜色混合器Color Mixer🖨️ RGB 与 CMYK 互转RGB to CMYK Converter🏷️ 颜色名称查询(最接近的 CSS 颜色名)Color Name Finder🌡️ 色温转 RGB(开尔文)Color Temperature to RGB (Kelvin)🎨 HEX 转 RGBHEX to RGB Converter

← 全部工具All tools