Skip to content

Make View's background_color attribute a property like Window's #2469

@pushfoo

Description

@pushfoo

Enhancement request:

What should be added/changed?

TL;DR: Make View handle background colors with validation like Window

In Window, we have a getter and setter for Window.background_color:

@background_color.setter
def background_color(self, value: RGBOrA255) -> None:
self._background_color = Color.from_iterable(value)

It seems worthwhile to:

  1. Add the same behavior to View
  2. Add tests to ensure homogeneous behavior

What would it help with?

  1. API consistency
  2. If @einarf approves making the default color for both BLACK instead of TRANSPARENT_BLACK:
    1. Screenshots will no longer be surprise-transparent
    2. Making screenshots for examples will be nicer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions