这是indexloc提供的服务,不要输入任何密码
Skip to content

BackgroundColor should return err instead of default #167

@eslam-allam

Description

@eslam-allam

The current implementation of BackgroundColor/ForegroundColor attempts to get the default color using a status report, or COLORFGBG if exists, or finally a default color if all else fails. I think this is problematic because I don't know whether the color I received was correct or not. This would make it impossible for me to restore the user's terminal to it's original colors. A much better approach in my opinion is to return an error telling me that the true color couldn't be fetched, giving me the chance to refrain from changing it in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions