วิธีแปลง RGB เป็นสีฐานสิบหก

วิธีแปลงจากรหัสสี RGB เป็นรหัสสีเลขฐานสิบหก

สี RGB

สี RGB คือการรวมกันของสีแดง สีเขียว และสีน้ำเงิน:

(อาร์, จี, บี)

สีแดง เขียว และน้ำเงิน แต่ละตัวใช้ 8 บิต โดยมีค่าจำนวนเต็มตั้งแต่ 0 ถึง 255

ดังนั้นจำนวนสีที่สามารถสร้างได้คือ:

256×256×256 = 16777216 = 100000016

รหัสสีฐานสิบหก

รหัสสีฐานสิบหกคือเลขฐานสิบหก 6 หลัก (ฐาน 16):

RRGGBB 16

ตัวเลขด้านซ้าย 2 หลักแสดงถึงสีแดง

ตัวเลขตรงกลาง 2 ตัวแสดงถึงสีเขียว

ตัวเลขด้านขวา 2 หลักแสดงถึงสีฟ้า

การแปลง rgb เป็นฐานสิบหก

1. Convert the red, green, and blue values ​​from decimal to hex.
2. Combine the 3 hex values ​​of red, green and blue together: RRGGBB.

Example 1
Convert red (255,0,0) to hex color code:

R = 25510 = FF16

G = 010 = 0016

B = 010 = 0016

So the hex color code is:

Hex = FF0000

Example #2
Convert gold color (255,215,0) to hex color code:

R = 25510 = FF16

G = 21510 = D716

B = 010 = 0016

So the hex color code is:

Hex = FFD700

What does this RGB to Hex converter do?

It takes as input red, green and blue color values ​​ranging from 0 to 255 and then converts those values ​​into a hexadecimal string that can be used to specify colors in html/css code. Photo editing software usually represents color in RGB and so if you want to use the colors used in your photo editing software as the background of your HTML element you need to get the hexadecimal representation of RGB values. This tool allows you to get those values.

ลองใช้เครื่องมือค้นหาสีใหม่ของเรา

แปลงค่า Hex เป็น RGB

บางทีคุณอาจเห็นรหัสฐานสิบหกบนหน้าเว็บและต้องการใช้สีนั้นในซอฟต์แวร์แก้ไขรูปภาพของคุณในกรณีนั้นคุณจะต้องใช้ค่า RGB หากซอฟต์แวร์แก้ไขรูปภาพของคุณไม่รองรับค่า HEX

 

วิธีแปลง hex เป็น RGB ►

 


ดูสิ่งนี้ด้วย

Advertising

การแปลงสี
°• CmtoInchesConvert.com •°