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 Adaptation Handled Poorly (Aplite) #126

Open
gitgud-software opened this issue Jan 12, 2016 · 2 comments
Open

Color Adaptation Handled Poorly (Aplite) #126

gitgud-software opened this issue Jan 12, 2016 · 2 comments

Comments

@gitgud-software
Copy link

a comparison

The current Aplite builds for pebblejs adapt colors and make decisions about them poorly. As demonstrated by the comparison above, it is not always in the best interest of the developer to let the choice of color scheme for Aplite be handled by the build script. Ideally, decisions regarding how the app looks in Aplite should be possible to determine as a separate attributes.

{
  ...
  backgroundColor: 'blue',
  backgroundColorAplite: 'black',
  textColor: 'white',
  textColorAplite: 'white',
  ...
}

Color handling should only switch to defaults when an Aplite color attribute is not specified for an element.

@Meiguro
Copy link

Meiguro commented Jan 17, 2016

Ah, good point, I'll need to think about how to handle this (or use your suggestion!).
Probably something similar to the PBL_IF_COLOR macros in C would be preferable. In the mean time, you can use the undocumented Platform module:

var Platform = require('platform');
var color = Platform.version() === 'aplite' ? 'black' : 'blue';

The platform module was made for internal use, but I think it's very unlikely that usage would change. Its version function is a tiny wrapper around Pebble.getActiveWatchInfo().platform which is not always available.

@gitgud-software
Copy link
Author

This is incredibly helpful actually, I'm surprised it isn't in the documentation in the first place now that we have most applications building for multiple platforms. Glad to see that the support is there at least.

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

No branches or pull requests

2 participants