Module pix_engine::color::ops

source ·
Expand description

Color operation functions.

Provides numeric operations and trait implementations:

  • LowerHex: Allows displaying as lowercase hexadecimal value.
  • UpperHex: Allows displaying as uppercase hexadecimal value.
  • Index: Allows indexing to retrieve RGBA values. (e.g. color[0] for the red channel).
  • PartialEq and Eq: Allows comparison.
  • Hash: Allows hashing.

Also implemented are Add, Sub, AddAssign, and SubAssign with other Colors and u8 values channel-wise. Deref is also implemented which returns [u8; 4].