RGB to HEX مبدل
از RGB to HEX مبدل برای دریافت نتایج سریع و دقیق استفاده کنید.
نحوه استفاده از این ماشین حساب
- Red (0-255) را وارد کنید
- Green (0-255) را وارد کنید
- Blue (0-255) را وارد کنید
- روی دکمه محاسبه کلیک کنید
- نتیجه نمایش داده شده در زیر ماشین حساب را بخوانید
RGB to HEX Conversion
RGB (Red, Green, Blue) and HEX are two ways to represent the same color. Each RGB channel (0–255) is converted to a 2-digit hexadecimal value. HEX = # + (R in hex) + (G in hex) + (B in hex).
Common color examples:
- White: rgb(255,255,255) = #FFFFFF
- Black: rgb(0,0,0) = #000000
- Red: rgb(255,0,0) = #FF0000
- Blue: rgb(0,0,255) = #0000FF
- Orange: rgb(255,165,0) = #FFA500
How to Convert RGB to HEX
To manually convert: take each channel value, divide by 16 to get the first digit, take the remainder as the second digit. For example, 255 ÷ 16 = 15 remainder 15 → FF. 128 ÷ 16 = 8 remainder 0 → 80. Then combine: #FF8000.
Web Design Usage
CSS accepts both rgb(R, G, B) and #RRGGBB formats. HEX codes are the most common in design tools (Figma, Photoshop, Sketch) and CSS stylesheets. RGB values are useful for programmatic color manipulation and opacity (rgba adds a 4th channel for alpha transparency).
Frequently Asked Questions
How do I convert RGB to HEX?
Convert each channel (0–255) to 2-digit hex and concatenate. Example: rgb(255, 99, 71) → #FF6347 (Tomato red).
What is the HEX code for white?
White is #FFFFFF (rgb 255, 255, 255).
Can I use RGB in CSS?
Yes. CSS accepts both formats: color: rgb(255, 128, 0) and color: #FF8000 produce the same result.
آخرین بهروزرسانی: March 2026