chore: Adaptive theme supports VSCode dark themes #2320
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request focuses on improving the theme management and color handling in the application. The most important changes include refactoring the theme generator, enhancing the
DynamicThemeProvider
component, and adding utility functions for color space conversions.Theme Management Enhancements:
src/webviews/theme/DynamicThemeProvider.tsx
: Refactored theDynamicThemeProvider
component to support adaptive themes and improved theme state management. [1] [2]src/webviews/theme/themeGenerator.ts
: Added functions to generate adaptive dark and light themes and a utility to extract brand tokens from a color palette.Utility Functions for Color Space Conversions:
src/webviews/theme/utils/csswg.ts
: Added various functions for color space conversions, including sRGB to LCH, LCH to sRGB, and chromatic adaptation between D65 and D50.src/webviews/theme/utils/geometry.ts
: Added utility functions for handling geometric operations on curves, such as getting points on a quadratic Bezier curve.Minor Refactoring:
src/webviews/QueryEditor/QueryPanel/QueryMonaco.tsx
andsrc/webviews/QueryEditor/ResultPanel/DataViewPanelJSON.tsx
: Updated import paths foruseVSCodeTheme
to reflect the new location inthemeGenerator
. [1] [2]src/webviews/index.tsx
: Enabled adaptive theme usage inDynamicThemeProvider
.