Online HSL to RGB color conversion

Online Web Code Test | Online Image Picker | Online Color Picker

HSL to RGB color conversion

Enter hue in degrees (°), saturation and lightness (0..100%) and press the Convert button:

Enter hue (H): °  
Enter saturation (S): %  
Enter lightness (L): %  
   
RGB hex code (#):  
Red color (R):  
Green color (G):  
Blue color (B):  
Color preview:  

RGB to HSL conversion ►

HSL to RGB transformation formula

When 0 ≤ H < 360, 0 ≤ S ≤ 1 and 0) × S

X = C × (1 - times;255, (G'+m)&instances;255,(B'+m)×255)

HSL (Hue, Saturation, and Lightness) and RGB (Red, Green, and Blue) are particular coloration models normally applied in laptop images and photograph processing. Converting a coloration from HSL to RGB permits you to symbolize the colour in terms of its crimson, green, and blue additives, that are usually used to display colors on video display units.

Here's how you may perform the conversion from HSL to RGB:

  • Normalize the hue fee (H) to a number of 0 to at least one via dividing it with the useful resource of 360 (the most charge for hue).
  • Normalize the saturation fee (S) and lightness price (L) to an expansion of 0 to at least one through dividing them with the useful resource of one hundred (the most values for saturation and lightness).
  • If the saturation rate (S) is 0 (achromatic colour), set all three RGB components to the lightness fee (L) expanded with the aid of 255 (the maximum rate for an 8-bit colour channel), rounded to the nearest complete amount.
  • If the saturation rate (S) is extra than 0, calculate the temporary variables based on the hue rate (H):
  • Calculate the temporary variable C = (1 - abs(2 * L - 1)) * S.

    Calculate the brief variables X = C * (1 - abs((H * 6) mod 2 - 1)).

    Calculate the quick variable m = L - C/2.

  • Determine which sextant the hue charge falls into (0 to 5) to set the initial RGB values:
  • If zero ≤ H < 1 or five ≤ H < 6, set the preliminary RGB values to (C, X, 0).

    If 1 ≤ H < 2, set the initial RGB values to (X, C, zero).

    If 2 ≤ H < 3, set the initial RGB values to (zero, C, X).

    If 3 ≤ H < four, set the initial RGB values to (zero, X, C).

    If four ≤ H < five, set the initial RGB values to (X, 0, C).

  • Add the brief variable m to each RGB detail and multiply through 255, rounding to the nearest complete amount.
  • After following those steps, you will have the RGB values representing the color in the type of 0 to 255. These values can then be used to reveal or manage the coloration in various applications.

    It's nicely well worth noting that there can be slight versions in the implementation of the conversion set of policies, especially in how the short values are calculated or rounded. Different programming languages or libraries may also additionally furthermore offer their very own talents or strategies for HSL to RGB conversion, so it's far beneficial to are looking for advice from the documentation particular to the language or library you're the use of for proper consequences.

HSL to RGB tone table

Color Color

name

(H,S,L) Hex (R,G,B)
  Black (0°,0%,0%) #000000 (0,0,0)
  White (0°,0%,100%) #FFFFFF (255,255,255)
  Red (0°,100%,50%) #FF0000 (255,0,0)
  Lime (120°,100%,50%) #00FF00 (0,255,0)
  Blue (240°,100%,50%) #0000FF (0,0,255)
  Yellow (60°,100%,50%) #FFFF00 (255,255,0)
  Cyan (180°,100%,50%) #00FFFF (0,255,255)
  Magenta (300°,100%,50%) #FF00FF (255,0,255)
  Silver (0°,0%,75%) #BFBFBF (191,191,191)
  Gray (0°,0%,50%) #808080 (128,128,128)
  Maroon (0°,100%,25%) #800000 (128,0,0)
  Olive (60°,100%,25%) #808000 (128,128,0)
  Green (120°,100%,25%) #008000 (0,128,0)
  Purple (300°,100%,25%) #800080 (128,0,128)
  Teal (180°,100%,25%) #008080 (0,128,128)
  Navy (240°,100%,25%) #000080 (0,0,128)

 

RGB to HSL conversion ►

 



Online Color Calculators

Online Web Code Test | Online Image Picker | Online Color Picker

Color Calculators