set_alpha

set_alpha(color, alpha)[source]

Return a color with the opacity channel set to the specified value.

Parameters
  • color (color-spec) – The color. Sanitized with to_rgba.

  • alpha (float, optional) – The new opacity. Should be between 0 and 1.