AbraCalc

ตัวแปลงสี HSL เป็น RGB

แปลงค่าสี HSL (hue, saturation, lightness) เป็น RGB ได้ทันที

ฝังเครื่องมือนี้ในเว็บไซต์ของคุณ
อ้างอิงเครื่องมือนี้

APA

AbraCalc. (2026). ตัวแปลงสี HSL เป็น RGB [Online calculator]. Retrieved from https://abracalc.com/th/plaeng-hsl-rgb/

BibTeX

@misc{abracalc-plaeng-hsl-rgb, author = {AbraCalc}, title = {ตัวแปลงสี HSL เป็น RGB}, year = {2026}, howpublished = {\url{https://abracalc.com/th/plaeng-hsl-rgb/}} }

เครื่องมือนี้ตอบคำถามของคุณหรือไม่

วิธีใช้เครื่องมือนี้

  1. กรอก hue (0–360°), saturation (0–100%) และ lightness (0–100%)
  2. เครื่องมือจะแสดงค่า red, green และ blue ที่เทียบเท่า (0–255)
  3. คัดลอกสตริง rgb() ไปใช้ใน CSS หรืออ่านค่าตัวเลข R, G, B แต่ละค่า

แปลงค่า HSL (Hue, Saturation, Lightness) กลับเป็น RGB สำหรับใช้ในรูปภาพ Canvas หรือที่ใดก็ตามที่ต้องการค่า RGB

สูตร

Given H (0–360°), S (0–100%), L (0–100%), normalize: h = H/360, s = S/100, l = L/100.

If s = 0, then R = G = B = round(l × 255) (achromatic).

Otherwise compute chroma anchors:
q = l < 0.5 ? l(1+s) : l + s − l×s
p = 2l − q

Then use the piecewise hue-to-RGB helper for each channel:
R = hue2rgb(p, q, h + 1/3)
G = hue2rgb(p, q, h)
B = hue2rgb(p, q, h − 1/3)
where hue2rgb(p,q,t) maps t into the interval [0,1] and interpolates between p and q.

คำถามที่พบบ่อย

การแปลง HSL เป็น RGB ทำงานอย่างไร?
อัลกอริทึมจะแปลง saturation/lightness เป็นค่ากลาง จากนั้นจับคู่มุม hue กับแต่ละช่องสัญญาณ R, G, B โดยใช้ฟังก์ชันแบบเป็นช่วง
hsl(120, 100%, 50%) คืออะไร?
นั่นคือสีเขียวบริสุทธิ์: rgb(0, 255, 0)

แหล่งอ้างอิง