Skip to content

Expose MapPallette.colors, Add MapPallette.getNearestColor #12907

@EvertBt

Description

@EvertBt

Is your feature request related to a problem?

Yes, recently all MapPallette methods like matchColor have been deprecated, with the only info received was to 'use color-related methods'. I have been unable find any of these mentioned color related methods.

I require the functionality to be able to match a given color to the closest map color.

Describe the solution you'd like.

  • expose MapPallette.colors, perhaps through MapPallette.getColors(), so that all available Colors can be known by plugins.

  • add a method like Color MapPallette.getNearestColor(Color c)

Describe alternatives you've considered.

MapPallette.colors could be accessed with reflection, and from there on we could write our own algorithm to match to the nearest color. But this does not seem like good practice, especially because the server already has all of this logic internally.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueSimple bug fix or feature which would be a good first PR for someone new to the projectstatus: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions