Skip to content

Add a color role#70

Open
kahrendt wants to merge 4 commits intomainfrom
color-role
Open

Add a color role#70
kahrendt wants to merge 4 commits intomainfrom
color-role

Conversation

@kahrendt
Copy link
Copy Markdown
Contributor

@kahrendt kahrendt commented Mar 4, 2026

Adds a new color role to the spec. This allows the server to send RGBA color data to clients for various purposes. It specifies background, foreground, accent, a light color for use on dark backgrounds, and a dark color use on light backgrounds.

README.md Outdated
- `color`: object
- `timestamp`: integer - server clock time in microseconds for when these colors are valid
- `background?`: integer[] | null - background color as `[R, G, B, A]` with values 0-255
- `foreground?`: integer[] | null - foreground/text color as `[R, G, B, A]` with values 0-255
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably having RGB values for the foreground is a bit too custom for some UI clients?

What if we instead either have a boolean property is_dark? If its true the clients knows to use white text. If false it uses black instead.

Alternatively we could also have two backgrounds, one background_dark and one background_light so each client can decide by itself based on whether its in dark or light mode.

Or a mix of both? have two backgrounds and a boolean property that says whether the server would prefer the client to go into dark or light mode.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced foreground with is_dark boolean.

I don't know if we can easily generate a background for dark themes and light themes easily on the server side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants