Closed ariel-phet closed 9 years ago
The wavelength slider is a common-code component. It shows the entire visible spectrum, and currently has no ability to specify a subset (or subsets?) of that spectrum. So scenery-phet.WavelengthSlider will require modification.
The visible spectrum is 380 to 780 nm. Please specify which portion of that spectrum should be omitted. Hopefully it is 380 to some value. If it's a range in the middle of the spectrum, that will significantly complicate the modifications required to WavelengthSlider.
Finally... Presumably this is a fix that will not be applied to the Java version of the sim. @ariel-phet please confirm.
Correct, Java version will be left alone.
@pixelzoom "purple" basically does not appear in the actual spectrum, so something needs to be adjusted with color mapping and such
From wikipedia: http://en.wikipedia.org/wiki/Visible_spectrum
The spectrum does not, however, contain all the colors that the human eyes and brain can distinguish. Unsaturated colors such as pink, or purple variations such as magenta, are absent, for example, because they can be made only by a mix of multiple wavelengths. Colors containing only one wavelength are also called pure colors or spectral colors.
For instance, we don't have "pink" in our spectrum
Then it sounds like the problem is in scenery-phet.VisibleColor, which maps wavelengths to RGB values. VisibleColor is a port from Java common code, and was written circa 2004. I have no recollection of where the algorithm came from.
This is a nice little tool (but still an approximation since color perception is kind of hideously complicated)
http://academo.org/demos/wavelength-to-colour-relationship/
It looks like maybe in the Blue/Violet crossover (around 410 nm) we need to choose a different color,
The algorithm that we're using in VisibleColor is apparently fairly standard.
Here it is on StackOverflow: http://stackoverflow.com/questions/1472514/convert-light-frequency-to-rgb
Here it is in Python: http://www.noah.org/wiki/Wavelength_to_RGB_in_Python
Here it is in JavaScript: http://scienceprimer.com/javascript-code-convert-light-wavelength-color
Also note that modifying this implementation will change not only Color Vision, but all current and future sims that use VisibleColor.
Understood, but it seems we really shouldn't be showing purple if that color does not appear in the actual spectrum (regardless of simulation context).
The top-voted StackOverflow post (see above link) says:
the Fourmilab article makes the important point that some colours are not representable in RGB (bright oranges being a good example) because you cannot "make" arbitrary colours of light by adding three primary colours together, whatever our physics teachers may have told us (well mine did). Too bad, but in practice not usually fatal.
The Fourmilelab article is at http://www.fourmilab.ch/documents/specrend/, and recommends the algorithm that we are currently using in VisibleColor.
Hmm, seems like truncating the spectrum on the first screen might be a solution.
Seems like a good topic to bring up for Status meeting.
@pixelzoom can you put this on your list of Status meeting discussion topics for this week.
Consensus at 4/23/15 status meeting: Leave sim and VisibleColor as-is, mention this issue in the teacher tips. Assigning to @ariel-phet to reply to the customer.
I have replied to the customer. I will open an issue for the teacher tips.
A user wrote in to phethelp and said
The user is correct and we should remove the ability to make purple photons on the first screen. (This is basically only an issue on the first screen with the bulb and purple filter). It seems the easiest solution would be to remove this area of the spectrum from the filter spectrum, the bulb spectrum, and the model.