Skip to content

p5.Color.equals method #7949

@aidanwyber

Description

@aidanwyber

Increasing access

Sometimes it's useful to be able to be able to compare colors against stored colours, for example, when sampling an image with a constrained palette. It would be great if you could compare p5.Color objects with eachother, which is kind of a hassle now.

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

Feature enhancement details

I suggest creating a equals() method like in string objects. I could be a piecewise comparison of either of the p5.Color.levels or p5.Color._array arrays, but I don't quite understand what their difference is in practice (which one is the master).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions