Skip to content

Commit

Permalink
Rename from simColorProfileProperty to SimColors.js, see phetsims/sce…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jul 28, 2021
1 parent d4c9ef1 commit cdae751
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ProfileColorProperty from '../../../../scenery/js/util/ProfileColorProper
import ratioAndProportion from '../../ratioAndProportion.js';

// Even though there is only one Profile, it is still nice to use this pattern for color organizing.
const RAPColorProfile = {
const RAPColors = {
tickMarksAndLabelsInFitnessProperty: new ProfileColorProperty( 'tickMarksAndLabelsInFitness', {
default: Color.DARK_GRAY
} ),
Expand Down Expand Up @@ -50,5 +50,5 @@ const RAPColorProfile = {
} )
};

ratioAndProportion.register( 'RAPColorProfile', RAPColorProfile );
export default RAPColorProfile;
ratioAndProportion.register( 'RAPColors', RAPColors );
export default RAPColors;
12 changes: 6 additions & 6 deletions js/common/view/RAPScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import BothHandsDescriber from './describers/BothHandsDescriber.js';
import HandPositionsDescriber from './describers/HandPositionsDescriber.js';
import RatioDescriber from './describers/RatioDescriber.js';
import TickMarkDescriber from './describers/TickMarkDescriber.js';
import RAPColorProfile from './RAPColorProfile.js';
import RAPColors from './RAPColors.js';
import RAPMarkerInput from './RAPMarkerInput.js';
import RAPTickMarkLabelsNode from './RAPTickMarkLabelsNode.js';
import RatioHalf from './RatioHalf.js';
Expand Down Expand Up @@ -118,8 +118,8 @@ class RAPScreenView extends ScreenView {

const tickMarksAndLabelsColorProperty = new DerivedProperty( [ model.ratioFitnessProperty ],
fitness => Color.interpolateRGBA(
RAPColorProfile.tickMarksAndLabelsOutOfFitnessProperty.value,
RAPColorProfile.tickMarksAndLabelsInFitnessProperty.value, fitness
RAPColors.tickMarksAndLabelsOutOfFitnessProperty.value,
RAPColors.tickMarksAndLabelsInFitnessProperty.value, fitness
) );

// Tick mark sounds get played when ratio isn't locked, and when staccato sounds aren't playing
Expand Down Expand Up @@ -282,13 +282,13 @@ class RAPScreenView extends ScreenView {
], ( fitness, inProportion ) => {
let color = null;
if ( inProportion ) {
color = RAPColorProfile.backgroundInFitnessProperty.value;
color = RAPColors.backgroundInFitnessProperty.value;
}
else {
const interpolatedDistance = ( fitness - rapConstants.RATIO_FITNESS_RANGE.min ) / ( 1 - model.getInProportionThreshold() );
color = Color.interpolateRGBA(
RAPColorProfile.backgroundOutOfFitnessProperty.value,
RAPColorProfile.backgroundInterpolationToFitnessProperty.value,
RAPColors.backgroundOutOfFitnessProperty.value,
RAPColors.backgroundInterpolationToFitnessProperty.value,
Utils.clamp( interpolatedDistance, 0, 1 )
);
}
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/RatioHandNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ratioAndProportion from '../../ratioAndProportion.js';
import rapConstants from '../rapConstants.js';
import CueDisplay from './CueDisplay.js';
import getKeyboardInputSnappingMapper from './getKeyboardInputSnappingMapper.js';
import RAPColorProfile from './RAPColorProfile.js';
import RAPColors from './RAPColors.js';
import TickMarkView from './TickMarkView.js';

class RatioHandNode extends Node {
Expand Down Expand Up @@ -102,7 +102,7 @@ class RatioHandNode extends Node {
const rightHandFlipScale = new Vector2( ( options.isRight ? 1 : -1 ), 1 );

const cueArrowOptions = {
fill: RAPColorProfile.cueArrowsProperty,
fill: RAPColors.cueArrowsProperty,
stroke: 'black',
headWidth: 40,
headHeight: 20,
Expand Down
4 changes: 2 additions & 2 deletions js/create/view/CreateScreenIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ScreenIcon from '../../../../joist/js/ScreenIcon.js';
import NumberPicker from '../../../../scenery-phet/js/NumberPicker.js';
import HBox from '../../../../scenery/js/nodes/HBox.js';
import VBox from '../../../../scenery/js/nodes/VBox.js';
import RAPColorProfile from '../../common/view/RAPColorProfile.js';
import RAPColors from '../../common/view/RAPColors.js';
import ratioAndProportion from '../../ratioAndProportion.js';


Expand All @@ -22,7 +22,7 @@ class CreateScreenIcon extends ScreenIcon {
*/
constructor( options ) {

const numberPickerColor = RAPColorProfile.createScreenHandProperty;
const numberPickerColor = RAPColors.createScreenHandProperty;
const numberPickerRange = new Range( 0, 10 );

const leftNode = new VBox( {
Expand Down
4 changes: 2 additions & 2 deletions js/create/view/CreateScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RichText from '../../../../scenery/js/nodes/RichText.js';
import Checkbox from '../../../../sun/js/Checkbox.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import ActivationUtterance from '../../../../utterance-queue/js/ActivationUtterance.js';
import RAPColorProfile from '../../common/view/RAPColorProfile.js';
import RAPColors from '../../common/view/RAPColors.js';
import RAPScreenView from '../../common/view/RAPScreenView.js';
import ratioAndProportion from '../../ratioAndProportion.js';
import ratioAndProportionStrings from '../../ratioAndProportionStrings.js';
Expand All @@ -29,7 +29,7 @@ class CreateScreenView extends RAPScreenView {
constructor( model, tandem ) {

// For this screen, one Property controls the color of both hands.
const handColorProperty = RAPColorProfile.createScreenHandProperty;
const handColorProperty = RAPColors.createScreenHandProperty;

super( model, tandem, {
leftHandColorProperty: handColorProperty,
Expand Down
8 changes: 4 additions & 4 deletions js/discover/view/ChallengeRatioComboBoxNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import challenge1SelectionSound from '../../../../tambo/sounds/selection-arpeggi
import challenge2SelectionSound from '../../../../tambo/sounds/selection-arpeggio-004_mp3.js';
import challenge3SelectionSound from '../../../../tambo/sounds/selection-arpeggio-006_mp3.js';
import Utterance from '../../../../utterance-queue/js/Utterance.js';
import RAPColorProfile from '../../common/view/RAPColorProfile.js';
import RAPColors from '../../common/view/RAPColors.js';
import ratioAndProportion from '../../ratioAndProportion.js';
import ratioAndProportionStrings from '../../ratioAndProportionStrings.js';
import ChallengeComboBoxItem from './ChallengeComboBoxItem.js';
Expand Down Expand Up @@ -57,15 +57,15 @@ class ChallengeRatioComboBoxNode extends Node {
tagName: 'h3'
} );
this.comboBox = new ComboBox( [
new ChallengeComboBoxItem( this.ratioToChallengeNameMap.get( 1 / 2 ).capitalized, RAPColorProfile.discoverChallenge1Property.value, 1 / 2, targetRatioProperty, colorProperty, {
new ChallengeComboBoxItem( this.ratioToChallengeNameMap.get( 1 / 2 ).capitalized, RAPColors.discoverChallenge1Property.value, 1 / 2, targetRatioProperty, colorProperty, {
soundPlayer: soundGenerators[ 0 ],
a11yLabel: ratioAndProportionStrings.challenge1
} ),
new ChallengeComboBoxItem( this.ratioToChallengeNameMap.get( 1 / 3 ).capitalized, RAPColorProfile.discoverChallenge2Property.value, 1 / 3, targetRatioProperty, colorProperty, {
new ChallengeComboBoxItem( this.ratioToChallengeNameMap.get( 1 / 3 ).capitalized, RAPColors.discoverChallenge2Property.value, 1 / 3, targetRatioProperty, colorProperty, {
soundPlayer: soundGenerators[ 1 ],
a11yLabel: ratioAndProportionStrings.challenge2
} ),
new ChallengeComboBoxItem( this.ratioToChallengeNameMap.get( 3 / 4 ).capitalized, RAPColorProfile.discoverChallenge3Property.value, 3 / 4, targetRatioProperty, colorProperty, {
new ChallengeComboBoxItem( this.ratioToChallengeNameMap.get( 3 / 4 ).capitalized, RAPColors.discoverChallenge3Property.value, 3 / 4, targetRatioProperty, colorProperty, {
soundPlayer: soundGenerators[ 2 ],
a11yLabel: ratioAndProportionStrings.challenge3
} )
Expand Down
4 changes: 2 additions & 2 deletions js/discover/view/DiscoverScreenIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import merge from '../../../../phet-core/js/merge.js';
import HBox from '../../../../scenery/js/nodes/HBox.js';
import Rectangle from '../../../../scenery/js/nodes/Rectangle.js';
import VBox from '../../../../scenery/js/nodes/VBox.js';
import RAPColorProfile from '../../common/view/RAPColorProfile.js';
import RAPColors from '../../common/view/RAPColors.js';
import RatioHandNode from '../../common/view/RatioHandNode.js';
import TickMarkView from '../../common/view/TickMarkView.js';
import ratioAndProportion from '../../ratioAndProportion.js';
Expand All @@ -27,7 +27,7 @@ class DiscoverScreenIcon extends ScreenIcon {

options = merge( {
fill: 'white',
handColor: RAPColorProfile.discoverChallenge1Property.value
handColor: RAPColors.discoverChallenge1Property.value
}, options );

const tickMarksHiddenProperty = new Property( TickMarkView.NONE );
Expand Down

0 comments on commit cdae751

Please sign in to comment.