Re-read graph CSS variables and update canvas background + label styles.
()
| 1204 | |
| 1205 | /** Re-read graph CSS variables and update canvas background + label styles. */ |
| 1206 | setThemeColors(): void { |
| 1207 | if (!this.app) return; |
| 1208 | const themeColors = getGraphThemeColors(); |
| 1209 | |
| 1210 | // Update Pixi canvas background |
| 1211 | this.app.renderer.background.color = hexToNum(themeColors.bg); |
| 1212 | |
| 1213 | // Update all existing label styles |
| 1214 | for (const node of this.nodes.values()) { |
| 1215 | if (!node.label) continue; |
| 1216 | const s = node.label.style; |
| 1217 | s.fill = themeColors.labelColor; |
| 1218 | if (s.dropShadow && typeof s.dropShadow === 'object') { |
| 1219 | s.dropShadow = { |
| 1220 | ...s.dropShadow, |
| 1221 | color: themeColors.labelShadow, |
| 1222 | }; |
| 1223 | } |
| 1224 | } |
| 1225 | } |
| 1226 | |
| 1227 | private applyVisuals(): void { |
| 1228 | if (!this.app) return; |
no test coverage detected