Skip to content

Commit

Permalink
Added a color profile for #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh Totey authored and Saurabh Totey committed Jul 19, 2021
1 parent a5ac52f commit 1be4c48
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
22 changes: 22 additions & 0 deletions js/common/NLDColorProfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2021, University of Colorado Boulder

/**
* The color profile for this sim.
*
* @author Saurabh Totey
*/

import ProfileColorProperty from '../../../scenery/js/util/ProfileColorProperty.js';
import numberLineDistance from '../numberLineDistance.js';

const NLDColorProfile = {
genericScreenBackgroundColorProperty: new ProfileColorProperty( 'genericBackground', {
default: 'rgb( 245, 255, 254 )'
} ),
exploreScreenBackgroundColorProperty: new ProfileColorProperty( 'exploreBackground', {
default: 'rgb( 254, 247, 233 )'
} )
};

numberLineDistance.register( 'NLDColorProfile', NLDColorProfile );
export default NLDColorProfile;
4 changes: 2 additions & 2 deletions js/explore/NLDExploreScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import Screen from '../../../joist/js/Screen.js';
import numberLineDistanceStrings from '../numberLineDistanceStrings.js';
import Property from '../../../axon/js/Property.js';
import numberLineDistance from '../numberLineDistance.js';
import NLDExploreModel from './model/NLDExploreModel.js';
import NLDExploreScreenView from './view/NLDExploreScreenView.js';
import exploreHomeIcon from '../../images/explore-home-icon_png.js';
import exploreNavbarIcon from '../../images/explore-navbar-icon_png.js';
import ScreenIcon from '../../../joist/js/ScreenIcon.js';
import Image from '../../../scenery/js/nodes/Image.js';
import NLDColorProfile from '../common/NLDColorProfile.js';

const screenExploreString = numberLineDistanceStrings.screen.explore;

Expand All @@ -28,7 +28,7 @@ class NLDExploreScreen extends Screen {
constructor( tandem ) {
const options = {
name: screenExploreString,
backgroundColorProperty: new Property( 'rgb( 254, 247, 233 )' ),
backgroundColorProperty: NLDColorProfile.exploreScreenBackgroundColorProperty,
homeScreenIcon: new ScreenIcon( new Image( exploreHomeIcon ), {
maxIconWidthProportion: 1,
maxIconHeightProportion: 1
Expand Down
4 changes: 2 additions & 2 deletions js/generic/NLDGenericScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import Screen from '../../../joist/js/Screen.js';
import numberLineDistanceStrings from '../numberLineDistanceStrings.js';
import Property from '../../../axon/js/Property.js';
import numberLineDistance from '../numberLineDistance.js';
import NLDGenericModel from './model/NLDGenericModel.js';
import NLDGenericScreenView from './view/NLDGenericScreenView.js';
import genericHomeIcon from '../../images/generic-home-icon_png.js';
import genericNavbarIcon from '../../images/generic-navbar-icon_png.js';
import ScreenIcon from '../../../joist/js/ScreenIcon.js';
import Image from '../../../scenery/js/nodes/Image.js';
import NLDColorProfile from '../common/NLDColorProfile.js';

const screenGenericString = numberLineDistanceStrings.screen.generic;

Expand All @@ -28,7 +28,7 @@ class NLDGenericScreen extends Screen {
constructor( tandem ) {
const options = {
name: screenGenericString,
backgroundColorProperty: new Property( 'rgb( 245, 255, 254 )' ),
backgroundColorProperty: NLDColorProfile.genericScreenBackgroundColorProperty,
homeScreenIcon: new ScreenIcon( new Image( genericHomeIcon ), {
maxIconWidthProportion: 1,
maxIconHeightProportion: 1
Expand Down

1 comment on commit 1be4c48

@pixelzoom
Copy link
Contributor

Choose a reason for hiding this comment

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

#48

Please sign in to comment.