microsoft / microsoft/WinAppVSCE

XAML: Show color swatches for named colors (e.g. Red, CornflowerBlue)

Open
#209 1 comment 0 reactions 1 assignee View on GitHub

@chiaramooney is already working on this.

Since Sep 8, 2026.

enhancement
Dominant language
TypeScript
Stars
13
Forks
3
Avg merge
6d 1h
Merged PRs (30d)
11

Description

Summary

The XAML language server currently shows color swatches only for hex color literals (e.g. #FF0000). Named WinUI colors like Red, CornflowerBlue, DarkSlateGray should also display inline color swatches in the editor.

Current state

  • XamlColor.cs parses hex literals and returns ColorInformation to the LSP client
  • XamlTypeSystem.GetNamedColors() already discovers named color constants via Roslyn (e.g. Microsoft.UI.Colors.Red)
  • However, Roslyn cannot evaluate property getters at design time, so the actual RGBA values for named colors are not available from the type system alone

Proposed approach

Import a build-time lookup table of named color → RGBA mappings from the WinAppSDK source (or a generated resource). This table would be used by XamlColor to resolve named colors to their swatch values without requiring runtime evaluation.

Related

  • PR #50 (XAML language service integration)
  • server/src/WinUiXaml.LanguageServer/XamlColor.cs
  • server/src/WinUiXaml.Workspace/XamlTypeSystem.cs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.