Skip to content

Add methods to support generating color palettes#6720

Merged
AJCM-git merged 11 commits into
space-wizards:masterfrom
mqole:robust-colors
Jul 11, 2026
Merged

Add methods to support generating color palettes#6720
AJCM-git merged 11 commits into
space-wizards:masterfrom
mqole:robust-colors

Conversation

@mqole

@mqole mqole commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

adds methods to Color.cs that support generating:

  • complementary colors
  • split complementary colors
  • triadic palettes
image

(ANALOGOUS NOT INCLUDED)
EDIT: ANALOGOUS NOW INCLUDED

this pr is required for space-wizards/space-station-14#38528.

@AJCM-git AJCM-git left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return a color array

Comment thread Robust.Shared.Maths/Color.cs Outdated
Comment thread Robust.Shared/ColorExtensions/ColorExtensions.cs Outdated

@dffdff2423 dffdff2423 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below.

I think you should also maybe add a basic unit test or two but that would be something up to the maintainers.

Comment thread Robust.Shared/ColorExtensions/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs
Comment thread Robust.Shared/ColorExtensions/ColorExtensions.cs Outdated
Comment thread Robust.Shared/ColorExtensions/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated

@metalgearsloth metalgearsloth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also really do with a test.

Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
@mqole

mqole commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

i think i did the angles properly, will need someone to check working.
EDIT: i do not think i did the angles properly

no idea how to write integration test. tried looking for examples in the codebase as well as slam's unmerged tutorial, but the tutorial is more geared towards content and all the codebase examples in robust i found were either 7 years old, inconsistently formatted to each other, or both.

EDIT 2: never mind im basically smart

@whatston3 whatston3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more thoughts.

I think the constants based on the angles you had before should work better (slightly more precise). The values you're testing could be based off of your constants, too.

Haven't tested the suggestions, all webedit ops, so do take care.

Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared.Tests/Utility/ColorExtensionsTest.cs Outdated
@mqole

mqole commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author
image what i love to see!

@mqole mqole requested a review from whatston3 July 6, 2026 14:45

@whatston3 whatston3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reads fine to me, pardon the annoyance.

[Also, didn't say it yet but this is a very nice PR. Good stuff.]

@mqole mqole requested a review from metalgearsloth July 8, 2026 10:38
Comment thread Robust.Shared/Utility/ColorExtensions.cs Outdated
Comment thread Robust.Shared.Tests/Utility/ColorExtensionsTest.cs Outdated
Comment thread Robust.Shared.Tests/Utility/ColorExtensionsTest.cs Outdated
@mqole mqole requested a review from Tayrtahn July 10, 2026 14:40
@AJCM-git AJCM-git merged commit 292dedc into space-wizards:master Jul 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants