Skip to content

Conversation

@dmitrivMS
Copy link
Contributor

Fixes #256853

Added unit-tests, including tests for the related issues.

The main change is to let Color.Format.CSS functions handle the alpha channel which they seem to be doing just fine (including HEX/HEXA formats).

Copilot AI review requested due to automatic review settings December 24, 2025 10:30
@dmitrivMS dmitrivMS added the editor-color-picker Editor color picker widget issues label Dec 24, 2025
@dmitrivMS dmitrivMS enabled auto-merge December 24, 2025 10:30
@dmitrivMS dmitrivMS requested a review from aiday-mar December 24, 2025 10:30
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 24, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #256853 where fully opaque colors (alpha=1) were incorrectly appending an alpha suffix to hex color formats. The fix simplifies the code by delegating alpha channel handling entirely to the Color.Format.CSS functions, which already have the correct logic built-in.

  • Simplified color formatting by removing manual alpha channel checks
  • Added comprehensive unit tests covering opaque, transparent, and semi-transparent colors
  • Included regression tests for both the current issue (#256853) and the related issue (#243746)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts Simplified color formatting logic by delegating to Color.Format.CSS functions which handle alpha channel internally
src/vs/editor/contrib/colorPicker/test/browser/defaultDocumentColorProvider.test.ts Added comprehensive test suite covering opaque, transparent, and semi-transparent colors with regression tests

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

Labels

editor-color-picker Editor color picker widget issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color picker uses incorrect alpha formats

3 participants