Skip to content

Proposal: Add Color.IsEmpty and Color.Empty #2826

@robloo

Description

@robloo

Proposal: Add Color.IsEmpty and Color.Empty

Summary

The Color struct in UWP/WinUI does not currently have an IsEmpty property or an Empty color field. This creates complications when trying to handle #00000000. Lack of support for this is likely also an issue with the WinUI ColorPicker (though I'm not addressing that here). This needs to be added just like it was in System.Drawing.Color from WPF.

API to add:

public static readonly Color Empty;
public bool IsEmpty { get; }

Rationale

Empty colors need to be fully supported without special code every time it's needed. Empty colors represent 'null' for no color has been selected or set. This is valid information that needs to be retained especially in pickers.

Scope

Capability Priority
public static readonly Color Empty Must
public bool IsEmpty Must

Important Notes

  • Color is missing several other properties that probably should be discussed as well IsKnownColor, IsNamedColor etc...

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)team-ControlsIssue for the Controls team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions