Skip to content

Commit

Permalink
Changed Color Mapping from Theme to TurboColorRamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalabint committed Jul 12, 2024
1 parent a854eb2 commit e9e325d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
23 changes: 7 additions & 16 deletions src/common/util/colors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/map/MapRoutePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ const MapRoutePath = ({ positions }) => {
},
properties: {
color: reportColor || getSpeedColor(
theme.palette.success.main,
theme.palette.warning.main,
theme.palette.error.main,
positions[i + 1].speed,
maxSpeed,
),
Expand Down
4 changes: 1 addition & 3 deletions src/map/MapRoutePoints.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { useId, useCallback, useEffect } from 'react';
import { useTheme } from '@mui/styles';
import { map } from './core/MapView';
import { getSpeedColor } from '../common/util/colors';

const MapRoutePoints = ({ positions, onClick }) => {
const id = useId();
const theme = useTheme();

const onMouseEnter = () => map.getCanvas().style.cursor = 'pointer';
const onMouseLeave = () => map.getCanvas().style.cursor = '';
Expand Down Expand Up @@ -72,7 +70,7 @@ const MapRoutePoints = ({ positions, onClick }) => {
index,
id: position.id,
rotation: position.course,
color: getSpeedColor(theme.palette.success.main, theme.palette.warning.main, theme.palette.error.main, position.speed, maxSpeed),
color: getSpeedColor(position.speed, maxSpeed),
},
})),
});
Expand Down

0 comments on commit e9e325d

Please sign in to comment.