Repository navigation
Description
The skills do not cover two cases where an app can drift away from the theme and the form factor: custom Skia drawing and custom controls that need breakpoints. As a result, agents hard-code colours in Skia renderers (SKColors.X, new SKColor(0x...), fixed palette arrays), so charts and canvases stay in one theme. They also compare ActualWidth in code to adapt the drawing. The skills should show how a Skia surface reads theme colours and redraws, and how custom controls get their breakpoints from {utu:Responsive}.
Where it happens
- No skill under
skills/covers theme colours inSKCanvasElementorSKXamlCanvasdrawing. uno-toolkit/references/responsive.mdcovers{utu:Responsive}andResponsiveViewfor standard XAML only, and says nothing about custom or Skia controls.
In the Studio sample apps we measured, the Skia charts, the heatmap and the 3D views carry most of the C# colour literals. One chart is fixed to dark mode.
Expected
Skia drawing reads the theme. A custom surface exposes one Brush dependency property per role it draws with, and the app binds each one with {ThemeResource}. The control converts the colour to an SKColor on the UI thread and calls Invalidate(). A ThemeResource binding re-resolves when the theme changes, so the drawing follows light, dark and palette edits without app wiring. Handling ActualThemeChanged covers the colours resolved some other way.
<local:HarbourCanvas AccentBrush="{ThemeResource PrimaryBrush}"
AlarmBrush="{ThemeResource ErrorBrush}"
GroundBrush="{ThemeResource SurfaceContainerHighBrush}" />Series and ramps bind one brush per role and interpolate between two of them in code, with no fixed colour arrays.
Form factor for custom controls. Breakpoint decisions come in through properties bound with {utu:Responsive} on the Toolkit breakpoints:
<local:LiveChart Density="{utu:Responsive Narrow=Compact, Wide=Full}"
LegendPlacement="{utu:Responsive Narrow=Bottom, Wide=Right}" />The control scales its geometry to the size it gets, but it never decides a breakpoint from ActualWidth.
Suggested changes
- Add a short Skia theming reference, under
uno-themesor a new Skia topic: the brush-property pattern above, the role mapping for series and status colours (see Skills allow colour, spacing and radius literals outside the palette override, so apps ignore theme edits #228 for the palette-only rule), and a runtime check that the surface repaints on a theme switch and a palette edit. - Add a "custom and Skia controls" section to
uno-toolkit/references/responsive.md.
Open questions
- Both patterns still need a run on Uno.Sdk 7 in a sample: the theme-change redraw, and
{utu:Responsive}converting a string to an enum-typed custom property. We will report the results here.
Activity