Skip to content

Commit

Permalink
TRAN-7485-2: hardcode amtrak colors (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshverma authored Oct 18, 2023
1 parent 3ac491c commit 6576540
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gtfs_realtime_translators/translators/njt_rail.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def __make_trip_updates(cls, data):
headsign = item_entry['DESTINATION']
route_short_name = cls.__get_route_short_name(item_entry)
route_long_name = cls.__get_route_long_name(item_entry)
route_color = item_entry['BACKCOLOR']
route_text_color = item_entry['FORECOLOR']
route_color = cls.__get_route_color(item_entry, route_id)
route_text_color = cls.__get_route_text_color(item_entry, route_id)
block_id = item_entry['TRAIN_ID']
track = item_entry['TRACK']
stop_id = data['STATION']['STATION_2CHAR']
Expand Down Expand Up @@ -169,3 +169,15 @@ def __get_route_short_name(cls, data):
if data['LINEABBREVIATION'] == 'AMTK':
return data['LINE']
return data['LINEABBREVIATION']

@classmethod
def __get_route_color(cls, data, route_id):
if route_id == 'AMTK':
return '#FFFF00'
return data['BACKCOLOR']

@classmethod
def __get_route_text_color(cls, data, route_id):
if route_id == 'AMTK':
return '#000000'
return data['FORECOLOR']

0 comments on commit 6576540

Please sign in to comment.