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 9b4b30c commit bc09c4b
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 113 deletions.
6 changes: 3 additions & 3 deletions js/buoyancy/view/BuoyancyApplicationsScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import RectangularRadioButtonGroup from '../../../../sun/js/buttons/RectangularR
import DensityBuoyancyCommonConstants from '../../common/DensityBuoyancyCommonConstants.js';
import Cuboid from '../../common/model/Cuboid.js';
import Material from '../../common/model/Material.js';
import densityBuoyancyCommonColorProfile from '../../common/view/densityBuoyancyCommonColorProfile.js';
import DensityBuoyancyCommonColors from '../../common/view/DensityBuoyancyCommonColors.js';
import DensityBuoyancyScreenView from '../../common/view/DensityBuoyancyScreenView.js';
import DensityControlNode from '../../common/view/DensityControlNode.js';
import DisplayOptionsNode from '../../common/view/DisplayOptionsNode.js';
Expand Down Expand Up @@ -251,8 +251,8 @@ class BuoyancyApplicationsScreenView extends DensityBuoyancyScreenView {
deselectedLineWidth: 1.5,
touchAreaXDilation: 6,
touchAreaYDilation: 6,
selectedStroke: densityBuoyancyCommonColorProfile.radioBorderColorProperty,
baseColor: densityBuoyancyCommonColorProfile.radioBackgroundColorProperty,
selectedStroke: DensityBuoyancyCommonColors.radioBorderColorProperty,
baseColor: DensityBuoyancyCommonColors.radioBackgroundColorProperty,

bottom: this.layoutBounds.bottom - MARGIN,
left: densityControlPanel.right + MARGIN
Expand Down
6 changes: 3 additions & 3 deletions js/buoyancy/view/BuoyancyExploreScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import AccordionBox from '../../../../sun/js/AccordionBox.js';
import Panel from '../../../../sun/js/Panel.js';
import DensityBuoyancyCommonConstants from '../../common/DensityBuoyancyCommonConstants.js';
import Material from '../../common/model/Material.js';
import densityBuoyancyCommonColorProfile from '../../common/view/densityBuoyancyCommonColorProfile.js';
import DensityBuoyancyCommonColors from '../../common/view/DensityBuoyancyCommonColors.js';
import DensityControlNode from '../../common/view/DensityControlNode.js';
import DisplayOptionsNode from '../../common/view/DisplayOptionsNode.js';
import GravityControlNode from '../../common/view/GravityControlNode.js';
Expand Down Expand Up @@ -54,13 +54,13 @@ class BuoyancyExploreScreenView extends SecondaryMassScreenView {
const densityAText = new Text( '', {
maxWidth: 120,
font: new PhetFont( { size: 14, weight: 'bold' } ),
fill: densityBuoyancyCommonColorProfile.labelAProperty,
fill: DensityBuoyancyCommonColors.labelAProperty,
layoutOptions: { x: 1, y: 0 }
} );
const densityBText = new Text( '', {
maxWidth: 120,
font: new PhetFont( { size: 14, weight: 'bold' } ),
fill: densityBuoyancyCommonColorProfile.labelBProperty,
fill: DensityBuoyancyCommonColors.labelBProperty,
layoutOptions: { x: 1, y: 1 }
} );

Expand Down
6 changes: 3 additions & 3 deletions js/common/DensityBuoyancyCommonConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import PhetFont from '../../../scenery-phet/js/PhetFont.js';
import densityBuoyancyCommon from '../densityBuoyancyCommon.js';
import densityBuoyancyCommonColorProfile from './view/densityBuoyancyCommonColorProfile.js';
import DensityBuoyancyCommonColors from './view/DensityBuoyancyCommonColors.js';

const CORNER_RADIUS = 5;

Expand All @@ -35,7 +35,7 @@ const DensityBuoyancyCommonConstants = {
// @public {Object}
PANEL_OPTIONS: {
cornerRadius: CORNER_RADIUS,
fill: densityBuoyancyCommonColorProfile.panelBackgroundProperty,
fill: DensityBuoyancyCommonColors.panelBackgroundProperty,
xMargin: 10,
yMargin: 10
},
Expand All @@ -46,7 +46,7 @@ const DensityBuoyancyCommonConstants = {
titleYMargin: 5,
buttonXMargin: 5,
titleAlignX: 'left',
fill: densityBuoyancyCommonColorProfile.panelBackgroundProperty
fill: DensityBuoyancyCommonColors.panelBackgroundProperty
}
};

Expand Down
36 changes: 18 additions & 18 deletions js/common/model/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ReferenceIO from '../../../../tandem/js/types/ReferenceIO.js';
import StringIO from '../../../../tandem/js/types/StringIO.js';
import densityBuoyancyCommon from '../../densityBuoyancyCommon.js';
import densityBuoyancyCommonStrings from '../../densityBuoyancyCommonStrings.js';
import densityBuoyancyCommonColorProfile from '../view/densityBuoyancyCommonColorProfile.js';
import DensityBuoyancyCommonColors from '../view/DensityBuoyancyCommonColors.js';

class Material {
/**
Expand Down Expand Up @@ -178,13 +178,13 @@ Material.CEMENT = new Material( {
name: densityBuoyancyCommonStrings.material.cement,
identifier: 'CEMENT',
density: 3150,
liquidColor: densityBuoyancyCommonColorProfile.materialCementColorProperty
liquidColor: DensityBuoyancyCommonColors.materialCementColorProperty
} );
Material.COPPER = new Material( {
name: densityBuoyancyCommonStrings.material.copper,
identifier: 'COPPER',
density: 8960,
liquidColor: densityBuoyancyCommonColorProfile.materialCopperColorProperty
liquidColor: DensityBuoyancyCommonColors.materialCopperColorProperty
} );
Material.DIAMOND = new Material( {
name: densityBuoyancyCommonStrings.material.diamond,
Expand Down Expand Up @@ -215,7 +215,7 @@ Material.LEAD = new Material( {
name: densityBuoyancyCommonStrings.material.lead,
identifier: 'LEAD',
density: 11342,
liquidColor: densityBuoyancyCommonColorProfile.materialLeadColorProperty
liquidColor: DensityBuoyancyCommonColors.materialLeadColorProperty
} );
Material.PLATINUM = new Material( {
name: densityBuoyancyCommonStrings.material.platinum,
Expand Down Expand Up @@ -266,98 +266,98 @@ Material.AIR = new Material( {
identifier: 'AIR',
density: 1.2,
viscosity: 0,
liquidColor: densityBuoyancyCommonColorProfile.materialAirColorProperty
liquidColor: DensityBuoyancyCommonColors.materialAirColorProperty
} );
Material.DENSITY_P = new Material( {
name: densityBuoyancyCommonStrings.material.densityP,
identifier: 'DENSITY_P',
density: 200,
liquidColor: densityBuoyancyCommonColorProfile.materialDensityPColorProperty,
liquidColor: DensityBuoyancyCommonColors.materialDensityPColorProperty,
hidden: true
} );
Material.DENSITY_Q = new Material( {
name: densityBuoyancyCommonStrings.material.densityQ,
identifier: 'DENSITY_Q',
density: 4000,
liquidColor: densityBuoyancyCommonColorProfile.materialDensityQColorProperty,
liquidColor: DensityBuoyancyCommonColors.materialDensityQColorProperty,
hidden: true
} );
Material.DENSITY_R = new Material( {
name: densityBuoyancyCommonStrings.material.densityR,
identifier: 'DENSITY_R',
density: 200,
liquidColor: densityBuoyancyCommonColorProfile.materialDensityRColorProperty,
liquidColor: DensityBuoyancyCommonColors.materialDensityRColorProperty,
hidden: true
} );
Material.DENSITY_S = new Material( {
name: densityBuoyancyCommonStrings.material.densityS,
identifier: 'DENSITY_S',
density: 4000,
liquidColor: densityBuoyancyCommonColorProfile.materialDensitySColorProperty,
liquidColor: DensityBuoyancyCommonColors.materialDensitySColorProperty,
hidden: true
} );
Material.DENSITY_X = new Material( {
name: densityBuoyancyCommonStrings.material.densityX,
identifier: 'DENSITY_X',
density: 500,
liquidColor: densityBuoyancyCommonColorProfile.materialDensityXColorProperty,
liquidColor: DensityBuoyancyCommonColors.materialDensityXColorProperty,
hidden: true
} );
Material.DENSITY_Y = new Material( {
name: densityBuoyancyCommonStrings.material.densityY,
identifier: 'DENSITY_Y',
density: 5000,
liquidColor: densityBuoyancyCommonColorProfile.materialDensityYColorProperty,
liquidColor: DensityBuoyancyCommonColors.materialDensityYColorProperty,
hidden: true
} );
Material.GASOLINE = new Material( {
name: densityBuoyancyCommonStrings.material.gasoline,
identifier: 'GASOLINE',
density: 680,
viscosity: 6e-4,
liquidColor: densityBuoyancyCommonColorProfile.materialGasolineColorProperty
liquidColor: DensityBuoyancyCommonColors.materialGasolineColorProperty
} );
Material.HONEY = new Material( {
name: densityBuoyancyCommonStrings.material.honey,
identifier: 'HONEY',
density: 1440,
viscosity: 0.03, // NOTE: actual value around 2.5, but we can get away with this for animation
liquidColor: densityBuoyancyCommonColorProfile.materialHoneyColorProperty
liquidColor: DensityBuoyancyCommonColors.materialHoneyColorProperty
} );
Material.MERCURY = new Material( {
name: densityBuoyancyCommonStrings.material.mercury,
identifier: 'MERCURY',
density: 13593,
viscosity: 1.53e-3,
liquidColor: densityBuoyancyCommonColorProfile.materialMercuryColorProperty
liquidColor: DensityBuoyancyCommonColors.materialMercuryColorProperty
} );
Material.OIL = new Material( {
name: densityBuoyancyCommonStrings.material.oil,
identifier: 'OIL',
density: 920,
viscosity: 0.02, // Too much bigger and it won't work, not particularly physical
liquidColor: densityBuoyancyCommonColorProfile.materialOilColorProperty
liquidColor: DensityBuoyancyCommonColors.materialOilColorProperty
} );
Material.SAND = new Material( {
name: densityBuoyancyCommonStrings.material.sand,
identifier: 'SAND',
density: 1442,
viscosity: 0.03, // Too much bigger and it won't work, not particularly physical
liquidColor: densityBuoyancyCommonColorProfile.materialSandColorProperty
liquidColor: DensityBuoyancyCommonColors.materialSandColorProperty
} );
Material.SEAWATER = new Material( {
name: densityBuoyancyCommonStrings.material.seawater,
identifier: 'SEAWATER',
density: 1029,
viscosity: 1.88e-3,
liquidColor: densityBuoyancyCommonColorProfile.materialSeawaterColorProperty
liquidColor: DensityBuoyancyCommonColors.materialSeawaterColorProperty
} );
Material.WATER = new Material( {
name: densityBuoyancyCommonStrings.material.water,
identifier: 'WATER',
density: 1000,
viscosity: 8.9e-4,
liquidColor: densityBuoyancyCommonColorProfile.materialWaterColorProperty
liquidColor: DensityBuoyancyCommonColors.materialWaterColorProperty
} );

// @public {Array.<Material>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const tandem = Tandem.GLOBAL_VIEW.createTandem( 'colorProfile' );

// Initial colors for each profile, by string key. Only profile currently is default (still helpful for making color
// tweaks with the top-level files)
const densityBuoyancyCommonColorProfile = {
const DensityBuoyancyCommonColors = {
// Color recommended in https://github.com/phetsims/density/issues/6#issuecomment-600911868
panelBackgroundProperty: new ProfileColorProperty( 'panelBackground', {
default: new Color( 240, 240, 240 )
Expand Down Expand Up @@ -250,6 +250,6 @@ const densityBuoyancyCommonColorProfile = {
} )
};

densityBuoyancyCommon.register( 'densityBuoyancyCommonColorProfile', densityBuoyancyCommonColorProfile );
densityBuoyancyCommon.register( 'DensityBuoyancyCommonColors', DensityBuoyancyCommonColors );

export default densityBuoyancyCommonColorProfile;
export default DensityBuoyancyCommonColors;
18 changes: 9 additions & 9 deletions js/common/view/DensityBuoyancyScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import ScaleReadoutNode from './ScaleReadoutNode.js';
import ScaleView from './ScaleView.js';
import VerticalCylinderView from './VerticalCylinderView.js';
import WaterLevelIndicator from './WaterLevelIndicator.js';
import densityBuoyancyCommonColorProfile from './densityBuoyancyCommonColorProfile.js';
import DensityBuoyancyCommonColors from './DensityBuoyancyCommonColors.js';

// constants
const MARGIN = DensityBuoyancyCommonConstants.MARGIN;
Expand Down Expand Up @@ -106,8 +106,8 @@ class DensityBuoyancyScreenView extends ScreenView {
// @private {Rectangle} - The sky background, in a unit 0-to-1 rectangle (so we can scale it to match)
this.backgroundNode = new Rectangle( 0, 0, 1, 1, {
fill: new LinearGradient( 0, 0, 0, 1 )
.addColorStop( 0, densityBuoyancyCommonColorProfile.skyTopProperty )
.addColorStop( 1, densityBuoyancyCommonColorProfile.skyBottomProperty )
.addColorStop( 0, DensityBuoyancyCommonColors.skyTopProperty )
.addColorStop( 1, DensityBuoyancyCommonColors.skyBottomProperty )
} );
this.visibleBoundsProperty.link( visibleBounds => {
this.backgroundNode.translation = visibleBounds.leftTop;
Expand Down Expand Up @@ -239,7 +239,7 @@ class DensityBuoyancyScreenView extends ScreenView {
), model.groundBounds.maxZ )
] ), 3 ) );
const groundMaterial = new THREE.MeshBasicMaterial();
densityBuoyancyCommonColorProfile.groundProperty.link( groundColor => {
DensityBuoyancyCommonColors.groundProperty.link( groundColor => {
groundMaterial.color = ThreeUtils.colorToThree( groundColor );
} );

Expand Down Expand Up @@ -318,7 +318,7 @@ class DensityBuoyancyScreenView extends ScreenView {
0, 1, 1
] );
topGeometry.addAttribute( 'color', new THREE.BufferAttribute( topColorArray, 3 ) );
densityBuoyancyCommonColorProfile.grassCloseProperty.link( grassCloseColor => {
DensityBuoyancyCommonColors.grassCloseProperty.link( grassCloseColor => {
for ( let i = 0; i < 18; i++ ) {
topColorArray[ i * 3 + 0 ] = grassCloseColor.r / 255;
topColorArray[ i * 3 + 1 ] = grassCloseColor.g / 255;
Expand All @@ -330,7 +330,7 @@ class DensityBuoyancyScreenView extends ScreenView {
topColorArray[ offset + 2 ] = topColorArray[ offset + 5 ] = topColorArray[ offset + 11 ] = grassCloseColor.b / 255;
topGeometry.attributes.color.needsUpdate = true;
} );
densityBuoyancyCommonColorProfile.grassFarProperty.link( grassFarColor => {
DensityBuoyancyCommonColors.grassFarProperty.link( grassFarColor => {
const offset = 3 * 2 * 6;
topColorArray[ offset + 6 ] = topColorArray[ offset + 12 ] = topColorArray[ offset + 15 ] = grassFarColor.r / 255;
topColorArray[ offset + 7 ] = topColorArray[ offset + 13 ] = topColorArray[ offset + 16 ] = grassFarColor.g / 255;
Expand Down Expand Up @@ -402,7 +402,7 @@ class DensityBuoyancyScreenView extends ScreenView {
-1, 0, 0
] ), 3 ) );
const poolMaterial = new THREE.MeshLambertMaterial();
densityBuoyancyCommonColorProfile.poolSurfaceProperty.link( poolSurfaceColor => {
DensityBuoyancyCommonColors.poolSurfaceProperty.link( poolSurfaceColor => {
poolMaterial.color = ThreeUtils.colorToThree( poolSurfaceColor );
} );

Expand Down Expand Up @@ -765,7 +765,7 @@ class DensityBuoyancyScreenView extends ScreenView {
const waterMaterial = new THREE.MeshLambertMaterial( {
transparent: true
} );
const waterColor = densityBuoyancyCommonColorProfile.materialWaterColorProperty.value;
const waterColor = DensityBuoyancyCommonColors.materialWaterColorProperty.value;
waterMaterial.color = ThreeUtils.colorToThree( waterColor );
waterMaterial.opacity = waterColor.alpha;

Expand Down Expand Up @@ -807,7 +807,7 @@ class DensityBuoyancyScreenView extends ScreenView {
const waterMaterial = new THREE.MeshLambertMaterial( {
transparent: true
} );
const waterColor = densityBuoyancyCommonColorProfile.materialWaterColorProperty.value;
const waterColor = DensityBuoyancyCommonColors.materialWaterColorProperty.value;
waterMaterial.color = ThreeUtils.colorToThree( waterColor );
waterMaterial.opacity = waterColor.alpha;

Expand Down
8 changes: 4 additions & 4 deletions js/common/view/DisplayOptionsNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Checkbox from '../../../../sun/js/Checkbox.js';
import densityBuoyancyCommon from '../../densityBuoyancyCommon.js';
import densityBuoyancyCommonStrings from '../../densityBuoyancyCommonStrings.js';
import DensityBuoyancyCommonConstants from '../DensityBuoyancyCommonConstants.js';
import densityBuoyancyCommonColorProfile from './densityBuoyancyCommonColorProfile.js';
import DensityBuoyancyCommonColors from './DensityBuoyancyCommonColors.js';

// constants
const arrowSpacing = 15;
Expand Down Expand Up @@ -65,7 +65,7 @@ class DisplayOptionsNode extends VBox {
xAlign: 'left'
} ),
new ArrowNode( 0, 0, arrowLength, 0, merge( {
fill: densityBuoyancyCommonColorProfile.gravityForceProperty
fill: DensityBuoyancyCommonColors.gravityForceProperty
}, arrowOptions ) )
]
} );
Expand All @@ -78,7 +78,7 @@ class DisplayOptionsNode extends VBox {
xAlign: 'left'
} ),
new ArrowNode( 0, 0, arrowLength, 0, merge( {
fill: densityBuoyancyCommonColorProfile.buoyancyForceProperty
fill: DensityBuoyancyCommonColors.buoyancyForceProperty
}, arrowOptions ) )
]
} );
Expand All @@ -91,7 +91,7 @@ class DisplayOptionsNode extends VBox {
xAlign: 'left'
} ),
new ArrowNode( 0, 0, arrowLength, 0, merge( {
fill: densityBuoyancyCommonColorProfile.contactForceProperty
fill: DensityBuoyancyCommonColors.contactForceProperty
}, arrowOptions ) )
]
} );
Expand Down
Loading

0 comments on commit bc09c4b

Please sign in to comment.