On this page
  1. colorsys.rgb_to_hls
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

colorsys.rgb_to_hls

Prev: colorsys.hsv_to_rgb | Up: colorsys | Next: colorsys.rgb_to_hsv
Rel: colorsys.hls_to_rgb, colorsys.hsv_to_rgb, colorsys.rgb_to_hsv, colorsys.rgb_to_yiq
Ref: docs.python.org — colorsys.rgb_to_hls
Tags: #public #python3 #stdlib #colorsys


Import

import colorsys
from colorsys import rgb_to_hls

Signature & Overview

colorsys.rgb_to_hls(r, g, b)

colorsys.rgb_to_hls() function.

Usage

import colorsys

h, l, s = colorsys.rgb_to_hls(1.0, 0.0, 0.0)
assert (round(h, 2), round(l, 2), round(s, 2)) == (0.0, 0.5, 1.0)

Gotchas

REPL Inspect

from colorsys import rgb_to_hls
help(rgb_to_hls)

Linked from

Related notes