ToolGlobalHubGlobal • Free • No sign-up

Tool

HEX#0F766E
RGB15, 118, 110
HSL—
← All Tools Home Every tool has its own page — bookmark it and come back any time.

Related tools

Color Converter

The Color Converter shows one colour in three formats at the same time: HEX, RGB and HSL. You can pick a colour with the colour picker or type a HEX code, and the swatch and all three result boxes update together.

The tool starts on the colour #0F766E. The picker and the HEX field stay in step: changing one updates the other, along with the RGB and HSL readouts.

How the Color Converter works

The tool treats HEX as the starting value. It expands a 3-digit HEX code by doubling each character, then reads the red, green and blue channels from the hexadecimal number. Those RGB values, each from 0 to 255, are then converted to HSL using the standard maximum/minimum channel method implemented in the code.

Formula: RGB channels are taken from the HEX value (R = value >> 16 & 255, G = value >> 8 & 255, B = value & 255). For HSL, with r, g, b scaled to 0–1: L = (max + min) / 2; if max ≠ min, S = d / (2 − max − min) when L > 0.5, otherwise S = d / (max + min), where d = max − min; H is calculated from the dominant channel and multiplied by 60. Hue, saturation and lightness are rounded to whole numbers.
  • Pick or type a colour: Use the colour picker, or type a 3-digit or 6-digit HEX code, with or without the leading #.
  • Check the HEX is accepted: The input is only applied when it matches a valid 3- or 6-digit hexadecimal pattern; it is then normalised to uppercase with a leading #.
  • Read the three values: The result boxes show the HEX code, the RGB values separated by commas, and the HSL values as degrees, percent and percent.
  • Use the swatch: The swatch under the inputs fills with the selected colour so you can check it visually against the numbers.

The only formats covered are HEX, RGB and HSL. There is no CMYK, HSV, named-colour lookup or alpha/transparency channel in this tool, and the picker works with 6-digit HEX values, so a 3-digit code you type is expanded to six digits for the picker. HSL saturation and lightness are shown as whole percentages and hue as whole degrees.

Worked examples

Example — the starting colour #0F766E

The default HEX value #0F766E converts to RGB 15, 118, 110, because 0F is 15, 76 is 118 and 6E is 110 in decimal. Its HSL value works out to 175°, 77%, 26% using the method above.

Example — a 3-digit HEX code

Typing #FFF expands each character, giving #FFFFFF. That converts to RGB 255, 255, 255 and HSL 0°, 0%, 100%, because all three channels are at their maximum and lightness is (1 + 1) / 2.

Color Converter FAQs

Which colour formats does this tool convert between?

HEX, RGB and HSL only. Enter a colour as HEX or with the picker, and the tool displays the HEX, RGB and HSL values together.

Can I type a HEX code without the # sign?

Yes. The validation accepts an optional leading #, and 3-digit or 6-digit codes. A valid code is then shown in uppercase with the # added.

What happens if I type an invalid HEX code?

Nothing changes. The code first checks the input against a 3- or 6-digit hexadecimal pattern and returns without updating the swatch or results if it does not match.

Why does the picker show a longer code than the one I typed?

The colour picker needs a 6-digit value. If you enter a 3-digit code such as #FFF, the tool expands it to #FFFFFF for the picker while keeping your colour the same.

Does the tool support transparency or CMYK?

No. There is no alpha channel and no CMYK output in the implementation — only HEX, RGB and HSL values are produced.

Related tools

Other converters and design-adjacent tools in the same family.

Unit Converter — Convert length, weight and temperature between common units.

JSON Formatter — Format, validate and minify JSON in your browser.

QR Code Generator — Turn text or a link into a QR code you can save.

Converters — Browse the full Converters category on ToolGlobalHub.