class documentation

class RGBPalette(Converter): (source)

View In Hierarchy

Converter for color pixels indexed by the TI palette

Class Method get Converts bytes -> tuple[RGB, RGB]
Class Method nearest Finds the nearest palette color to the given RGB components under the Euclidean metric
Class Method set Converts tuple[RGB, RBG] -> bytes
Class Variable Black Undocumented
Class Variable Blue Undocumented
Class Variable Brown Undocumented
Class Variable DarkGray Undocumented
Class Variable Gray Undocumented
Class Variable Green Undocumented
Class Variable LtBlue Undocumented
Class Variable LtGray Undocumented
Class Variable Magenta Undocumented
Class Variable MedGray Undocumented
Class Variable Navy Undocumented
Class Variable Orange Undocumented
Class Variable palette Undocumented
Class Variable Red Undocumented
Class Variable White Undocumented
Class Variable Yellow Undocumented
Type Alias _T Undocumented
@classmethod
def get(cls, data: bytes, **kwargs) -> _T: (source)

Converts bytes -> tuple[RGB, RGB]

Parameters
data:bytesThe raw bytes to convert
**kwargsUndocumented
Returns
_TThe pair of RGB values from the palette indexed by the nibbles in data
@classmethod
def nearest(cls, r: int, g: int, b: int) -> RGB: (source)

Finds the nearest palette color to the given RGB components under the Euclidean metric

Parameters
r:intThe red component
g:intThe green component
b:intThe blue component
Returns
RGBThe RGB components of the nearest palette color
@classmethod
def set(cls, value: _T, **kwargs) -> bytes: (source)

Converts tuple[RGB, RBG] -> bytes

Parameters
value:_TThe value to convert
**kwargsUndocumented
Returns
bytesThe byte formed by finding the indices of the colors nearest to the RGB values in value
Black: tuple[int, ...] = (source)

Undocumented

Blue: tuple[int, ...] = (source)

Undocumented

Brown: tuple[int, ...] = (source)

Undocumented

DarkGray: tuple[int, ...] = (source)

Undocumented

Gray: tuple[int, ...] = (source)

Undocumented

Green: tuple[int, ...] = (source)

Undocumented

LtBlue: tuple[int, ...] = (source)

Undocumented

LtGray: tuple[int, ...] = (source)

Undocumented

Magenta: tuple[int, ...] = (source)

Undocumented

MedGray: tuple[int, ...] = (source)

Undocumented

Navy: tuple[int, ...] = (source)

Undocumented

Orange: tuple[int, ...] = (source)

Undocumented

Undocumented

Undocumented

White: tuple[int, ...] = (source)

Undocumented

Yellow: tuple[int, ...] = (source)

Undocumented

Undocumented

Value
tuple[RGB, RGB]