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

Add support for dark player colors #20721

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Add support for dark player colors #20721

merged 1 commit into from
Mar 10, 2023

Conversation

PunkPun
Copy link
Member

@PunkPun PunkPun commented Mar 3, 2023

Follows up #19335
Partly addresses #20415

Some info on HSV color model:

  • H - hue (0° to 360°)
  • S - saturation (0% - 100%)
  • V - value (0% - 100%)
    • V has the simplest conversion from RGB, it's the value of the most pronounced color amongst the 3
  • When stored all are reduced to 0 - 1 float range

This PR adds support for player color brightness. The remapping is done by taking the hue and saturation from the player color, and for brightness multiplying V's of the remapped pixel and player color. In other words multiplying 2 percentages.

As a testcase I included the new WIP color picker. Both the color picker and validator aren't ready yet and will be done in follow up PR's

@PunkPun PunkPun requested a review from pchote March 3, 2023 11:52
@PunkPun PunkPun added this to the Next Release milestone Mar 3, 2023
@pchote
Copy link
Member

pchote commented Mar 4, 2023

OpenRA/TiberianDawnHD@45a699f applies this to TDHD. Looks fine now, IMO.

pchote
pchote previously approved these changes Mar 4, 2023
Copy link
Member

@pchote pchote left a comment

Choose a reason for hiding this comment

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

LGTM, but I did most of the changes so not sure how much this is worth!

RoosterDragon
RoosterDragon previously approved these changes Mar 9, 2023
@PunkPun
Copy link
Member Author

PunkPun commented Mar 9, 2023

dropped the testcase commit

@penev92 penev92 merged commit dab3ca0 into OpenRA:bleed Mar 10, 2023
@penev92
Copy link
Member

penev92 commented Mar 10, 2023

@PunkPun PunkPun deleted the darkness branch March 10, 2023 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants