Vscode-powershell: Add the ability to customize Session Status color

Created on 5 Mar 2019  路  12Comments  路  Source: PowerShell/vscode-powershell

Summary of the new feature

Currently the colors of session statuses are almost invisible when you are using a light color theme

        let statusIconText = "$(terminal) ";
        let statusColor = "#affc74";

        if (status === SessionStatus.Initializing) {
            statusIconText = "$(sync) ";
            statusColor = "#f3fc74";
        } else if (status === SessionStatus.Failed) {
            statusIconText = "$(alert) ";
            statusColor = "#fcc174";
        }
Area-UI Issue-Enhancement

Most helpful comment

would you mind attaching a screen shot of the session status

Yes, of course. Here it is

record_190306_103154

All 12 comments

@ihodev thanks for opening this issue--would you mind attaching a screen shot of the session status so we can better understand the problem--Thanks!

@TylerLeonhardt may have more experience in this area

would you mind attaching a screen shot of the session status

Yes, of course. Here it is

record_190306_103154

Thanks @ihodev that is very difficult to read!

@ihodev if we made this an easier color to read rather than make it customizable would that be satisfactory?

@SydneyhSmith I think if colors will have approximately the same lightness as a default status bar foreground color that will be ok.

I'd also like to add that the status bar items shouldn't explicitly set a color as that will cause accessibility issues with color contrast. There are also so many variables with themes that it will be impossible to find a single color that will work across all themes. See below for another example of how this is unreadable:

image

image

As someone who was several extensions that contribute to the status bar, I wouldn't want one extension to be highlighted more than others. I think what would work here is to remove statusColor and request a color token from the VS Code team so that theme authors can properly theme those items.

request a color token from the VS Code team so that theme authors can properly theme those items

@misolori isn't there a way to get theme colors from within an extension? Are you saying there's no option for specifically the status bar?

@TylerLeonhardt there is currently no way to use theme colors in the status bar from an extension. I think this should be requested for VS Code to support so that extensions don't have to hard code hex colors.

For now, maybe the extension should provide both fg & bg colors for the best contrast. Although that means that part of the status bar may not look good in all color schemes but at least it would be readable. :-)

opened an issue on VS Code here https://github.com/microsoft/vscode/issues/81401

Looks like we can add a color to the package.json and leverage that in our code somehow.

https://code.visualstudio.com/api/references/contribution-points#contributes.colors

Seems pretty straightforward.

Was this page helpful?
0 / 5 - 0 ratings