-
Notifications
You must be signed in to change notification settings - Fork 6
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
use ColorProfile in joist #222
Comments
Renaming and cleaning up sounds good. It needs to handle the case when a screen changes its background color (and its colors should be standard) and controls a number of colors, so I'm not sure I like a 'navbarFillProperty'. |
I wasn't sure why @jonathanolson concluded "I'm not sure I like a navbarFillProperty", can you elaborate? What if it was just an enum pattern with possible string values |
If it has the same functionality, because it's not just the navbar fill that changes? (e.g. in Molecule Shapes, it's called "Projector Mode" not "White Navbar Mode"). |
What about calling this the "theme"? The sim theme could be black, white or something else? |
I'm investigating factoring out a LookAndFeel instance, which will be a member of Sim, starting with the preliminary step of modeling the fill of the navigation bar. Once things are working and refactored, we can decide on names, etc. |
In the above commits, I created and factored out LookAndFeel. I tested with a light sim and a dark sim, and did not see any issues. But @jonathanolson @jbphet @pixelzoom @aaronsamuel137 and @bereaphysics should be on the lookout for issues that may have been introduced here. |
I'd also like to move backgroundColor to the LookAndFeel, instead of having it be ethereal in Sim.js. |
I moved backgroundColor to the LookAndFeel, and made everything else derived property. Seems much clearer now. I still have a bit more cleanup to do for the icons + highlighting. |
I have cleaned up many of the issues pertaining to the color by factoring out a LookAndFeel and using that as the basis for deriving visible properties. However, this comment is somewhat vague:
and I'm not sure what else I should address. Can @pixelzoom take a look? |
This looks much better. I would rename LookAndFeel to something like "theme" or "color scheme", because "look and feel" is too broad. From Wikipedia:
Unnecessary coupling is demonstrated in HomeButton, NavigationScreenButton, PhetButton, JoistButton. They require only navigationBarFillProperty, but they are passed the entire LookAndFeel. Undocumented assumptions and design flaws: (1) The navbar is either 'black' or 'white', and it must be one of those 2 strings (not Color.BLACK or Color.WHITE). This is not documented in LookAndFeel, where 'black' and 'white' appear repeatedly. And it's not documented in observers, where this type of test is repeated:
(2) If indeed 'black' and 'white' are the only 2 colors we'll need for the navbar, then it may be more appropriate to have '{Property.} navigationBarInverted' rather than a color. This might be clearer than the 'black' and 'white' value testing that's currently being done in observers. (3) The navbar will be 'white' only if the screen is 'black', and it's not clear that this design will make it easy to change that. Might we want a 'white' navbar for other dark background colors? |
Do you think this object (whatever its name) will eventually accumulate features that are looky-feely? Even if right now, it is only about colors, perhaps in the future we will want to change more features as described in the "Look and Feel" definition? |
If in the future, the entire LookAndFeel is providing more information than just colors (say it is fonts + styling, etc) then they may need the entire LookAndFeel, or at least more components from it. Still, for now, I'll pass in only what is necessary. |
…ton, PhetButton, JoistButton instead of the entire LookAndFeel, see #222
Would @pixelzoom prefer to (a) document existing enum-style pattern, (b) additionally factor out string constants 'white' and 'black' or (c) switch to using Color instances?
I cannot say for certain whether we will eventually need different navbar colors--but in any case, I think
Perhaps when this comes up, a good way to solve it would be to make the color derivation function in LookAndFeel an option. Should we eagerly add this feature now or wait until it comes up in context? I somewhat prefer the latter and think it would be straightforward when it comes up. |
I realize that it's been awhile, and I haven't gotten to this. If I don't get to it before @samreid's leave, I'll handle it. |
Status of this issue is that it's still very relevant. We standardized scenery-phet.ColorProfile. Now we need to use it in joist. And figure out how it relates to LookAndFeel. When we do this is up to project management priorities. |
This should also be addressed, from #255:
|
This issue came up again while investigation how to address #538. If joist used ColorProfiles, that issue would have been trivial to address. Instead, I'm having to wade into this odd LookAndFeel thing. LookAndFeel is something totally different than ColorProfiles, and it's a bit of a hack, based on whether the Screen's Joist should ditch LookAndFeel , and use color profiles, just like sims. It should have something like Things we'd need to discuss:
Labeling for discussion at developer meeting. Assigning to @ariel-phet to prioritize and assign. And I have to be honest; I'm not hugely excited to work on this, mainly because this aspect of joist is such a mess. |
I guess I don't understand how the 'default' and 'projector' would work. Some sims have a naturally white background (with a black navigation bar as default), and others have a black background (with a light navigation bar as default). |
There should be a default that works in most situations -- i.e., projector mode typically involves lightening up the screen background, and using a dark navigation bar. And the client should be able to override the default part of defining the 'default' and 'projector' profiles. |
I guess I'm just concerned that for sims with certain background colors, the sim's "normal" color profile would be paired with the "projector" profile for joist, and vice versa (being somewhat confusing). |
It can't be any more confusing (or brittle) than the current "invert" behavior in joist. E.g. #538 should be simple; instead it's a major project. |
11/19/18 dev meeting notes:
Self assigning to discuss with @ariel-phet. |
Unassigning. After looking around at the state of things, I'm not interested in tackling this. |
Looks like this is unlikely to get worked on by anyone anytime soon. There is good discussion in this issue, so going to mark deferred and remove assignees. If Joist gets some love sometime in the future, might be good to tackle then (likely for some a11y work). |
From phetsims/scenery-phet#515, we are getting a very new strategy about our color profiles. Note that this will likely apply to this issue. |
As I noted in #191 (comment) ...
@samreid also noted in #191 (comment):
The text was updated successfully, but these errors were encountered: