Output Color

Loading… Please Wait

About RGB to HWB Converter

Input an RGB value like rgb(0, 255, 255) and Diversify India’s RGB to HWB converter will convert this value to an HWB color like hwb(180deg 0% 0%).

RGB color parameters are red, green, and blue. The output HWB color parameters are hue, whiteness, and blackness.

Why Convert RGB to HWB?

Converting RGB to HWB is useful for simplifying color adjustments and improving the intuitive manipulation of colors. HWB (Hue, Whiteness, Blackness) offers a straightforward way to define colors in terms of their hue and the amounts of white and black added. This model is particularly beneficial for design tasks that require precise control over color lightness and shading, making it easier to create and modify color schemes.

How to Convert RGB to HWB

To convert RGB to HWB, follow these steps to transform the red, green, and blue components into hue, whiteness, and blackness.

  1. Extract the values for Red (R), Green (G), and Blue (B) from the RGB code.
    • Example: rgb(255, 109, 71) gives R = 255, G = 109, B = 71.
  2. Convert the RGB values to a range of 0 to 1 by dividing by 255.
    • R = 255 / 255 ≈ 1
    • G = 109 / 255 ≈ 0.43
    • B = 71 / 255 ≈ 0.278
  3. Calculate the minimum and maximum values among the normalized R, G, and B values, and find the difference.
    • Max = 1
    • Min = 0.278
    • Delta = Max – Min = 1 – 0.278 ≈ 0.722
  4. Calculate Hue (H).
    • If Max = R, H = 60 × ((G – B) / Delta % 6)
    • If Max = G, H = 60 × ((B – R) / Delta + 2)
    • If Max = B, H = 60 × ((R – G) / Delta + 4)
    • Example: Max = R, so H = 60 × ((0.43 – 0.278) / 0.722 % 6) ≈ 13 degrees
  5. Calculate Whiteness (W).
    • W = Min
    • Example: W = 0.278
  6. Calculate Blackness (B).
    • B = 1 – Max
    • Example: B = 1 – 1 = 0
  7. Convert Whiteness (W) and Blackness (B) to a percentage:
    • W = 0.278 × 100 ≈ 28%
    • B = 0 × 100 ≈ 0%
  8. Combine the HWB values.
    • Example: hwb(13deg 28% 0%)

List of Color Tools