-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
chore: switch back to @ctrl/tinycolor
#4077
Conversation
|
WalkthroughThe recent changes enhance color manipulation capabilities across the project by replacing the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Preferences
participant TinyColor
User->>Preferences: Request color conversion
Preferences->>TinyColor: Convert color using TinyColor
TinyColor-->>Preferences: Return converted color
Preferences-->>User: Display converted color
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (4)
- packages/@core/base/shared/package.json (1 hunks)
- packages/@core/base/shared/src/color/convert.ts (3 hunks)
- packages/effects/layouts/src/widgets/preferences/blocks/theme/builtin.vue (2 hunks)
- packages/effects/layouts/src/widgets/preferences/preferences-sheet.vue (1 hunks)
Files skipped from review due to trivial changes (1)
- packages/effects/layouts/src/widgets/preferences/preferences-sheet.vue
Additional comments not posted (5)
packages/@core/base/shared/src/color/convert.ts (3)
Line range hint
1-13
:
LGTM!The function
convertToHsl
correctly usesTinyColor
for converting colors to HSL format.
Line range hint
20-31
:
LGTM!The function
convertToHslCssVar
correctly usesTinyColor
for converting colors to HSL CSS variable format.
32-43
: LGTM!The function
convertToRgb
correctly handles the preprocessing step and usesTinyColor
for converting HLS color values to RGB strings.packages/@core/base/shared/package.json (1)
58-58
: LGTM!The dependency change from
@ant-design/fast-color
to@ctrl/tinycolor
is straightforward and aligns with the PR objectives.packages/effects/layouts/src/widgets/preferences/blocks/theme/builtin.vue (1)
Line range hint
12-25
:
LGTM!The import statement and the
inputValue
computed property correctly useTinyColor
for color handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/@core/base/shared/src/color/convert.test.ts (1 hunks)
- packages/@core/base/shared/src/color/generator.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- packages/@core/base/shared/src/color/convert.test.ts
Additional comments not posted (2)
packages/@core/base/shared/src/color/generator.ts (2)
16-16
: Verify the function usage and output.Ensure that the
new TinyColor(color).toHexString()
produces the expected results and is consistent with the previous implementation.
3-3
: Verify the new import usage.Ensure that the
TinyColor
import from./convert
is correctly implemented and consistent throughout the codebase.
Description
@antdesign/fast-color 和 @ctrl/tinycolor toHsl算法不同导致主题色会变化
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
TinyColor
library, including a new function to convert HLS values to RGB strings.Improvements
PreferenceBuiltinTheme
component for better color manipulation.Bug Fixes