Skip to content

wheel

palettes.wheel

pypalette.wheel

This module contains the cool wheel color palette as a class object.

Usage

from palettes import get_palette palette = get_palette(name="wheel", color_depth=16, swapped=False, length=256)

OR

palette = get_palette(name="wheel")

OR

from palettes.wheel import WheelPalette palette = WheelPalette(color_depth=16, swapped=False, length=256)

print(f"Palette: {palette.name}, Length: {len(palette)}") for i, color in enumerate(palette): for i, color in enumerate(palette): print(f"{i}. {color:#06X} {palette.color_name(i)}")

to access the named colors directly:

x = palette.RED x = palette.BLACK

Classes

WheelPalette

WheelPalette(name='', color_depth=16, swapped=False, cached=True, length=256, saturation=1.0, value=None)

A class to represent a color wheel as a palette.

Methods:
color_rgb
color_rgb(color)

color can be an 16-bit integer or a tuple, list or bytearray of length 2 or 3.