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

Color System #84

Open
3 tasks done
E-A-N opened this issue Nov 25, 2018 · 4 comments
Open
3 tasks done

Color System #84

E-A-N opened this issue Nov 25, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@E-A-N
Copy link
Collaborator

E-A-N commented Nov 25, 2018

  • create a module, name it colorSystem.js or something along those lines (this is not a gameState, so it's default)
  • update config with all variations of colors and corresponding number values
  • write algorithm to come up with the combined result of 2 colors. doesn't have to be some legit color theory rgba hex value, just something that works for the mechanic in game.
@E-A-N E-A-N added enhancement New feature or request help wanted Extra attention is needed labels Nov 25, 2018
@E-A-N
Copy link
Collaborator Author

E-A-N commented Nov 25, 2018

Hmmm apparently there's already a colorMixing.js. It's a self evoking function that returns an object of helper functions 🤔

Who ever takes on this task will probably just have to convert this file over our pattern usage.

@hal255
Copy link
Collaborator

hal255 commented Nov 25, 2018

ColorMixing was my initial take. I will need to review it again, but not sure if I can finish this in time. Monday is my soft deadline, back to the grind... 😟

@E-A-N
Copy link
Collaborator Author

E-A-N commented Nov 25, 2018

@hal255 no worries, we'll get it done. I can do it, or have someone else do it.

@Ricimon
Copy link
Collaborator

Ricimon commented Nov 28, 2018

So I wanted to share some research I did on color mixing, even though it wasn't really necessary to go this far :P

The standard color mixing done by computers in the RGB style is called additive mixing, as adding all three colors together will eventually produce white. This is because all the frequencies of the colored lights combine. In this mixing scheme, red, green, and blue are the primary colors.

The painter's color mixing is called subtractive mixing, and its primary colors are cyan, magenta, and yellow. With subtractive mixing, adding all three primary colors will produce black. This is because adding more differently-colored "paint" together absorbs more incoming light frequencies, allowing less frequencies of light to bounce back to the eye.

Now, the mixing scheme we seem to be using here has primary colors of red, yellow, and blue, according to #98. In an additive mixing scheme, mixing yellow and blue actually produces grey, not green, so this mixing scheme must be subtractive. However, the subtractive scheme's primary colors are cyan, magenta, and yellow, and the reason why red-yellow-blue caught on is literally because red is close to magenta, and blue is close to cyan, and that ended up being easier to teach in elementary school. It just so happens that red+yellow=orange and red+blue=purple coincidentally follow the additive mixing scheme.

So for this mixing algorithm (PR #105), I'll take advantage of that coincidence, but I added a special, hard-coded case for yellow+blue to produce green rather than grey.

Reference: http://wtamu.edu/~cbaird/sq/2015/01/22/why-are-red-yellow-and-blue-the-primary-colors-in-painting-but-computer-screens-use-red-green-and-blue/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants