Warn on opaque needsTransparency colors, expose to workbench#200052
Warn on opaque needsTransparency colors, expose to workbench#200052
Conversation
| * @description the description | ||
| */ | ||
| registerColor(id: string, defaults: ColorDefaults, description: string): ColorIdentifier; | ||
| registerColor(id: string, defaults: ColorDefaults, description: string, needsTransparency?: boolean): ColorIdentifier; |
There was a problem hiding this comment.
I wouldn't expect an option boolean parameter to registerColor to control linting settings, so I'd make it an option:
| registerColor(id: string, defaults: ColorDefaults, description: string, needsTransparency?: boolean): ColorIdentifier; | |
| registerColor(id: string, defaults: ColorDefaults, description: string, options?: { needsTransparency?: boolean }): ColorIdentifier; |
There was a problem hiding this comment.
@aeschli shall I do this consider we're exposing it on the registry interface now?
There was a problem hiding this comment.
The change is fine, but not really needed. ColorRegistry.registerColor already has that parameter and it is used at several places. @hediet I can make the suggested change when we get more arguments
| * @description the description | ||
| */ | ||
| registerColor(id: string, defaults: ColorDefaults, description: string): ColorIdentifier; | ||
| registerColor(id: string, defaults: ColorDefaults, description: string, needsTransparency?: boolean): ColorIdentifier; |
There was a problem hiding this comment.
The change is fine, but not really needed. ColorRegistry.registerColor already has that parameter and it is used at several places. @hediet I can make the suggested change when we get more arguments
fixes #200050
The relatively complex regex matches
#000e,#000000febut not#000f,#000000ff