@@ -7,6 +7,7 @@ import * as i18n from '../../core/i18n/i18n.js';
77import * as Platform from '../../core/platform/platform.js' ;
88import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js' ;
99import * as UI from '../../ui/legacy/legacy.js' ;
10+ import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js' ;
1011import * as VisualLogging from '../../ui/visual_logging/visual_logging.js' ;
1112
1213export class HeapTimelineOverview extends Common . ObjectWrapper . eventMixin < EventTypes , typeof UI . Widget . VBox > (
@@ -122,7 +123,7 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
122123 if ( this . running ) {
123124 context . beginPath ( ) ;
124125 context . lineWidth = 2 ;
125- context . strokeStyle = 'rgba(192, 192, 192, 0.6)' ;
126+ context . strokeStyle = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--sys-color-neutral-outline' ) ;
126127 const currentX = ( Date . now ( ) - startTime ) * scaleFactor ;
127128 context . moveTo ( currentX , height - 1 ) ;
128129 context . lineTo ( currentX , 0 ) ;
@@ -146,7 +147,7 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
146147 gridY = Math . round ( height - gridValue * yScaleFactor - 0.5 ) + 0.5 ;
147148 context . beginPath ( ) ;
148149 context . lineWidth = 1 ;
149- context . strokeStyle = 'rgba(0, 0, 0, 0.2)' ;
150+ context . strokeStyle = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--sys-color-on-surface-subtle' ) ;
150151 context . moveTo ( 0 , gridY ) ;
151152 context . lineTo ( width , gridY ) ;
152153 context . stroke ( ) ;
@@ -160,14 +161,14 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
160161
161162 context . beginPath ( ) ;
162163 context . lineWidth = 2 ;
163- context . strokeStyle = 'rgba(192, 192, 192, 0.6)' ;
164+ context . strokeStyle = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--sys-color-neutral-outline' ) ;
164165 aggregateAndCall ( topSizes , drawBarCallback ) ;
165166 context . stroke ( ) ;
166167 context . closePath ( ) ;
167168
168169 context . beginPath ( ) ;
169170 context . lineWidth = 2 ;
170- context . strokeStyle = 'rgba(0, 0, 192, 0.8)' ;
171+ context . strokeStyle = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--sys-color-primary-bright' ) ;
171172 aggregateAndCall ( sizes , drawBarCallback ) ;
172173 context . stroke ( ) ;
173174 context . closePath ( ) ;
@@ -181,9 +182,10 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
181182 context . beginPath ( ) ;
182183 context . textBaseline = 'bottom' ;
183184 context . font = '10px ' + window . getComputedStyle ( this . element , null ) . getPropertyValue ( 'font-family' ) ;
184- context . fillStyle = 'rgba(255, 255, 255, 0.75)' ;
185+ // Background behind text for better contrast. Some opacity so canvas can still bleed through
186+ context . fillStyle = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--color-background-opacity-80' ) ;
185187 context . fillRect ( labelX , labelY - gridLabelHeight , labelWidth , gridLabelHeight ) ;
186- context . fillStyle = 'rgb(64, 64, 64)' ;
188+ context . fillStyle = ThemeSupport . ThemeSupport . instance ( ) . getComputedValue ( '--sys-color-on-surface-subtle' ) ;
187189 context . fillText ( label , labelX + labelPadding , labelY ) ;
188190 context . fill ( ) ;
189191 context . closePath ( ) ;
0 commit comments