Skip to content

Useless complexity #9

Description

@vfsfitvnm

Hi, shouldn't this method be replaceable by the following simpler and more efficient code?

extension on Color {
  Color withIncrement(int amount) => 
    Color.fromRGBO(
      (this.red + amount).clamp(0, 255), (this.green + amount).clamp(0, 255), (this.blue + amount).clamp(0, 255), 1
    );
}

Or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions