Skip to content

Commit

Permalink
respect mode text color
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Oct 9, 2024
1 parent 17598ad commit f177bc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/actions/apiV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import {
getRouteColorBasedOnSettings,
getRouteIdForPattern,
getRouteTextColorBasedOnSettings,
routeIsValid
} from '../util/viewer'
import { isLastStop } from '../util/stop-times'
Expand Down Expand Up @@ -1144,6 +1145,16 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
config.transitOperators
),
{ color: leg?.route?.color, mode: leg.mode }
).split('#')?.[1],
textColor: getRouteTextColorBasedOnSettings(
getRouteOperator(
{
agencyId: leg?.agency?.id,
id: leg?.route?.id
},
config.transitOperators
),
{ color: leg?.route?.color, mode: leg.mode }
).split('#')?.[1]
}
}
Expand Down
4 changes: 4 additions & 0 deletions lib/util/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ export function getRouteColorBasedOnSettings(operator = {}, route = {}) {
return backgroundColor
}
}
export function getRouteTextColorBasedOnSettings(operator = {}, route = {}) {
const { color } = getColorAndNameFromRoute(operator, route)
return color
}

/**
* Helper method to determine if a stop being viewed is a flex stop. This is not marked by
Expand Down

0 comments on commit f177bc4

Please sign in to comment.