Skip to content

ItemRgb

Mojo struct 🡭

@register_passable_trivial
struct ItemRgb

BED itemRgb: either black (0) or (r,g,b) each 0-255.

  • r (UInt8)
  • g (UInt8)
  • b (UInt8)

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable, Writable

def __init__(r: UInt8, g: UInt8, b: UInt8) -> Self

Args:

  • r (UInt8)
  • g (UInt8)
  • b (UInt8)

Returns:

Self

def is_black(self) -> Bool

True if 0,0,0 (or the single 0 value).

Args:

  • self (Self)

Returns:

Bool

def write_to[w: Writer](self, mut writer: w)

Parameters:

  • w (Writer)

Args:

  • self (Self)
  • writer (w)