microsoft / microsoft/AdaptiveCards

[Feature Request] Add accent color to host data in Widgets board

Open
#8,313 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Problem Statement

It would be great to be able to create highly personalized widgets by using accent colors.

Proposed solution

I think that it should be show at host data as an hexadecimal string, so that host data looks like this:

{
    "widgetSize": "small",
    "hostTheme": "light"
    "accentColor": "#0067C0"
}

Using # maybe could lead into problems (i.e. using this field as fill color in svgs), %23 solves them.

Should be the same color than "+" buttons at "Add widgets" section on the widgets board and should be updated whenever the color changes, just like the "+" button does.

It should be added also to the designer sample host data.

Maybe ActionSet buttons and Hyperlink texts at RichTextBlock should use this accent color too.

Alternatives or Workarounds

Right now, in the app I'm developing, I use the following code to get the accent color to later dump it to the widget data:

var uiSettings = new UISettings();
var accentColor = uiSettings.GetColorValue(UIColorType.AccentLight2).ToString();
// I use UIColorType.AccentLight2 when dark theme is used and UIColorType.AccentDark1 when light theme is used

The problem with this is that when using the listener UISettings.ColorValuesChanged to track accent color changes, I can't find a Dispatcher that allows me to use uiSettings.GetColorValue(...) so this workaround isn't fully functional.

I have created this feature request too in the Feedback hub: https://aka.ms/AAjonzv

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.

Research direction

Start by tracing how Widgets board host data and the designer sample host data are assembled, then inspect the UISettings.ColorValuesChanged entry point described in the issue. Confirm where the Add widgets “+” button gets its color and define done as exposing that color in host data, keeping it updated, and deciding whether RichTextBlock links and ActionSet buttons should use it too.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.