Skip to content

Commit

Permalink
rename Properties for Diffusion particle colors, #77
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed May 3, 2024
1 parent ececabf commit c11da20
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions js/common/GasPropertiesColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,23 @@ const GasPropertiesColors = {
default: 'rgb( 255, 170, 170 )' // lighter shade of lightParticleColor
} ),

// primary color for 1st particle type in Diffusion screen
particle1ColorProperty: new ProfileColorProperty( gasProperties, 'particle1Color', {
// primary color for particle type 1 in Diffusion screen
diffusionParticle1ColorProperty: new ProfileColorProperty( gasProperties, 'diffusionParticle1Color', {
default: 'rgb( 0, 230, 255)' // cyan
} ),

// specular highlight for 1st particle type in Diffusion screen
particle1HighlightColorProperty: new ProfileColorProperty( gasProperties, 'particle1HighlightColor', {
// specular highlight for particle type 1 in Diffusion screen
diffusionParticle1HighlightColorProperty: new ProfileColorProperty( gasProperties, 'diffusionParticle1HighlightColor', {
default: 'rgb( 203, 247, 252 )' // lighter shade of particle1Color
} ),

// primary color for 2nd particle type in Diffusion screen
particle2ColorProperty: new ProfileColorProperty( gasProperties, 'particle2Color', {
// primary color for particle type 2 in Diffusion screen
diffusionParticle2ColorProperty: new ProfileColorProperty( gasProperties, 'diffusionParticle2Color', {
default: 'rgb( 232, 78, 32 )' // red
} ),

// specular highlight for 2nd particle type in Diffusion screen
particle2HighlightColorProperty: new ProfileColorProperty( gasProperties, 'particle2HighlightColor', {
// specular highlight for particle type 2 in Diffusion screen
diffusionParticle2HighlightColorProperty: new ProfileColorProperty( gasProperties, 'diffusionParticle2HighlightColor', {
default: 'rgb( 255, 170, 170 )' // lighter shade of particle2Color
} ),

Expand Down
6 changes: 3 additions & 3 deletions js/common/view/GasPropertiesIconFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ const GasPropertiesIconFactory = {
spacing: 12,
children: [
new Rectangle( 0, 0, width, height, {
fill: GasPropertiesColors.particle1ColorProperty,
fill: GasPropertiesColors.diffusionParticle1ColorProperty,
stroke: GasPropertiesColors.centerOfMassStrokeProperty
} ),
new Rectangle( 0, 0, width, height, {
fill: GasPropertiesColors.particle2ColorProperty,
fill: GasPropertiesColors.diffusionParticle2ColorProperty,
stroke: GasPropertiesColors.centerOfMassStrokeProperty
} )
]
Expand All @@ -390,7 +390,7 @@ const GasPropertiesIconFactory = {
createParticleFlowRateIcon(): Node {

const arrowOptions = {
fill: GasPropertiesColors.particle1ColorProperty,
fill: GasPropertiesColors.diffusionParticle1ColorProperty,
stroke: 'black',
headHeight: 12,
headWidth: 12,
Expand Down
4 changes: 2 additions & 2 deletions js/diffusion/model/DiffusionParticle1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default class DiffusionParticle1 extends DiffusionParticle {
super( optionize<DiffusionParticle1Options, SelfOptions, DiffusionParticleOptions>()( {

// DiffusionParticleOptions
colorProperty: GasPropertiesColors.particle1ColorProperty,
highlightColorProperty: GasPropertiesColors.particle1HighlightColorProperty
colorProperty: GasPropertiesColors.diffusionParticle1ColorProperty,
highlightColorProperty: GasPropertiesColors.diffusionParticle1HighlightColorProperty
}, providedOptions ) );
}
}
Expand Down
4 changes: 2 additions & 2 deletions js/diffusion/model/DiffusionParticle2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default class DiffusionParticle2 extends DiffusionParticle {
super( optionize<DiffusionParticle2Options, SelfOptions, DiffusionParticleOptions>()( {

// ParticleOptions
colorProperty: GasPropertiesColors.particle2ColorProperty,
highlightColorProperty: GasPropertiesColors.particle2HighlightColorProperty
colorProperty: GasPropertiesColors.diffusionParticle2ColorProperty,
highlightColorProperty: GasPropertiesColors.diffusionParticle2HighlightColorProperty
}, providedOptions ) );
}
}
Expand Down
8 changes: 4 additions & 4 deletions js/diffusion/view/DiffusionScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,27 @@ export default class DiffusionScreenView extends BaseScreenView {

// Center of Mass indicators
const centerOfMassNode1 = new CenterOfMassNode( model.centerOfMass1Property, model.container.bottom,
model.container.widthProperty, model.modelViewTransform, GasPropertiesColors.particle1ColorProperty, {
model.container.widthProperty, model.modelViewTransform, GasPropertiesColors.diffusionParticle1ColorProperty, {
visibleProperty: viewProperties.centerOfMassVisibleProperty
} );
const centerOfMassNode2 = new CenterOfMassNode( model.centerOfMass2Property, model.container.bottom,
model.container.widthProperty, model.modelViewTransform, GasPropertiesColors.particle2ColorProperty, {
model.container.widthProperty, model.modelViewTransform, GasPropertiesColors.diffusionParticle2ColorProperty, {
visibleProperty: viewProperties.centerOfMassVisibleProperty
} );

// Particle Flow Rate vectors
const particleFlowRateNode1 = new ParticleFlowRateNode( model.particle1FlowRateModel, {
visibleProperty: viewProperties.particleFlowRateVisibleProperty,
arrowNodeOptions: {
fill: GasPropertiesColors.particle1ColorProperty
fill: GasPropertiesColors.diffusionParticle1ColorProperty
},
centerX: containerNode.centerX,
top: containerNode.bottom + 38
} );
const particleFlowRateNode2 = new ParticleFlowRateNode( model.particle2FlowRateModel, {
visibleProperty: viewProperties.particleFlowRateVisibleProperty,
arrowNodeOptions: {
fill: GasPropertiesColors.particle2ColorProperty
fill: GasPropertiesColors.diffusionParticle2ColorProperty
},
centerX: containerNode.centerX,
top: particleFlowRateNode1.bottom + 5
Expand Down

0 comments on commit c11da20

Please sign in to comment.