Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow decorations to change the background of a cell #3770

Closed
Tyriar opened this issue May 9, 2022 · 0 comments · Fixed by #3775
Closed

Allow decorations to change the background of a cell #3770

Tyriar opened this issue May 9, 2022 · 0 comments · Fixed by #3775
Assignees
Labels
area/decorations type/enhancement Features or improvements to existing features
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented May 9, 2022

VS Code issue: microsoft/vscode#147013

The goal with decorations was to make them as flexible as possible which I think we accomplished by using a DOM element. Unfortunately I think to really get the full potential of decorations we need some renderer integration as well in order to change the background color of a cell, otherwise we would only ever be able to overlay a transparent color on top which ends up washing out colors and making it impossible to align with the editor in VS Code for example.

Provided it's simple we could also support changing the foreground color, this isn't mandatory for what we need anything because of the minimum contrast ratio setting.

Something else to think about is whether to support the alpha channel in the new API which would blend with the original background color.

Proposal:

export interface IDecoration extends IDisposableWithEvent {
    // To be able to dynamically change the colors without recreating the decoration
    options: Pick<IDecorationOptions, 'overviewRulerOptions' | 'backgroundColor' | 'foregroundColor'>;
}

export interface IDecorationOptions {
    /**
     * The background color of the cell(s).
     */
    backgroundColor?: string;
    
    /**
     * The foreground color of the cell(s).
     */
    foregroundColor?: string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/decorations type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant