Crate ecolor

source ·
Expand description

Color conversions and types.

If you want a compact color representation, use Color32. If you want to manipulate RGBA colors use Rgba. If you want to manipulate colors in a way closer to how humans think about colors, use HsvaGamma.

§Feature flags

  • extra_debug_asserts — Enable additional checks if debug assertions are enabled (debug builds).
  • extra_asserts — Always enable additional checks.

§Optional dependencies

  • bytemuckbytemuck enables you to cast ecolor types to &[u8].
  • cintcint enables interoperability with other color libraries.
  • color-hex — Enable the hex_color macro.
  • document-features — Enable this when generating docs.
  • serde — Allow serialization using serde.

Macros§

  • An assert that is only active when epaint is compiled with the extra_asserts feature or with the extra_debug_asserts feature in debug builds.
  • Construct a crate::Color32 from a hex RGB or RGBA string.

Structs§

  • This format is used for space-efficient color representation (32 bits).
  • Hue, saturation, value, alpha. All in the range [0, 1]. No premultiplied alpha.
  • Like Hsva but with the v value (brightness) being gamma corrected so that it is somewhat perceptually even.
  • 0-1 linear space RGBA color with premultiplied alpha.

Enums§

Functions§