Hoist duplicated Qt chart theme colours into a shared helper
Table of Contents
This page is a capture in the deferred bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
What
QColor(0xCB, 0xD5, 0xE1) (chart text) and the near-transparent white
grid colour are hardcoded independently in at least five places:
ReturnDistributionChart.cpp, SamplePricePathsChart.cpp,
FxSpotChartWindow.cpp, and MarketSimulatorWindow.cpp (two spots).
This exists because the app's dark theme is applied via QSS only
(never QApplication::setPalette), so QWidget::palette() can't be
used to derive chart colours reliably — see
GMM improvements: tidy up synthetic data generation loose ends's
chart-axes task for the investigation. Hoist these literals into a
small shared helper (e.g. a ChartTheme namespace/struct in
ores.qt common code) so all QtCharts call sites read from one place.
Why
Five independent copies of the same colour literals can silently drift out of sync as the theme evolves, and any future dark/light theme toggle would need to touch all five sites individually. Flagged during PR #1409 review as a non-blocking follow-up.
References
projects/ores.qt/synthetic/src/ReturnDistributionChart.cppprojects/ores.qt/synthetic/src/SamplePricePathsChart.cppprojects/ores.qt/mktdata/src/FxSpotChartWindow.cppprojects/ores.qt/synthetic/src/MarketSimulatorWindow.cpp