Skip to content

is inv on Colors well defined?  #488

Description

@anandijain

Base.inv(p::RGB) = RGB(1 - p.r, 1 - p.g, 1 - p.b)

I was trying to mess around with some of the common filters like inverting the colors, and it seems this would be well defined.

Also, I think this one allocates, so avoiding that would be nice

Is there a reason to not want to overload inv? would also want to generalize it to more than just RGB (its just the one I'm familiar with)

this would make it really easy to then take an image and just inv.(img) and get that classic "invert colors" effect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions