Skip to content

UI::Button uses foreground_color — consider adding text_color alias #9

@crimson-knight

Description

@crimson-knight

Context

When styling a UI::Button, the property to set the button's text color is foreground_color. While this is technically correct (foreground vs background), the more intuitive name for button text styling is text_color, which aligns with UI::Label and UI::Text conventions.

Problem

button = ::UI::Button.new("Click me")
button.text_color = ::UI::Color.new(1.0, 1.0, 1.0, 1.0)       # Expected — doesn't exist
button.foreground_color = ::UI::Color.new(1.0, 1.0, 1.0, 1.0)  # Actual property

Other text-bearing components like UI::Label use text_color. The inconsistency between text_color on labels and foreground_color on buttons causes confusion.

Proposal

Add text_color as an alias for foreground_color on UI::Button, or standardize on one name across all text-bearing components. Consistency is more important than which name wins.

Options:

  1. Add text_color alias on Button (delegates to foreground_color)
  2. Add foreground_color alias on Label/Text (delegates to text_color)
  3. Standardize all to text_color (breaking change on Button)

Option 1 is the least disruptive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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