Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] - color overflow in get_island_colored_map #2024

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

aclegg3
Copy link
Contributor

@aclegg3 aclegg3 commented Mar 1, 2023

Motivation and Context

If there are more islands than pre-set colors we should invent some new ones to avoid overflow.

Also fixes a bug with the images being reflected because PIL corrdinate system is +Y downwards with origin in the top left.

How Has This Been Tested

Locally with large disjoint navmeshes.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 1, 2023
@aclegg3 aclegg3 merged commit 107013b into main Mar 3, 2023
@aclegg3 aclegg3 deleted the island-colored-map-bugfix branch March 3, 2023 15:37
@Skylion007
Copy link
Contributor

@aclegg3 We shouldn't pick a random color, we should try to pick colors that are maximally far away from each other in the appropiate colorspace like HSV. There is a nice algorithm to do this which is used for colormaps, but it's a bit tricky here since we have a manual colormap defined first and then we have to exhaust the remaining colors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants