-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feature: compose settings refinement #859
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6f4b8cd
to
42a8d0f
Compare
This commit introduces the implementation of the HCT (Hue, Chroma, Tone) color system, which provides a perceptually accurate color measurement. The HCT color system is built on the CAM16 color appearance model and L* from L*a*b*. Key changes include: - **Hct.kt:** Defines the `Hct` class, allowing colors to be represented and manipulated in the HCT color space. It includes methods for setting hue, chroma, and tone, and for converting between HCT and ARGB color representations. - **Cam16.kt:** Defines the `Cam16` class, which is a color appearance model, used by the `Hct` class. It handles the conversion of colors between various viewing conditions. - **HctSolver.kt:** Defines the `HctSolver` object, which provides the algorithm to find sRGB color values with specific hue, chroma and L*. - **ViewingConditions.kt:** Defines the `ViewingConditions` class, which is used by the `Cam16` class to model the viewing environment of a color. - **MathUtils.kt:** Provides utility functions for mathematical operations, including linear interpolation, clamping, and degree sanitization. - **ColorUtils.kt:** Provides utility methods for color space conversions (e.g., ARGB to XYZ, XYZ to ARGB, ARGB to L*a*b*) and other color-related calculations. - **StringUtils.kt:** Provides utility methods for string representations of colors.
This commit introduces dynamic color support by adding new files: Monet.kt, ColorSpec.kt, PaletteStyle.kt, and TonalPalettes.kt. - `Monet.kt`: Provides the dynamicColorScheme function to generate a ColorScheme based on system settings and defines extension properties for easier color access. - `ColorSpec.kt`: Defines the ColorSpec data class, which allows for custom adjustments to chroma and hue shift of colors. - `PaletteStyle.kt`: Introduces the PaletteStyle class with predefined styles like TonalSpot, Spritz, Vibrant, Expressive, Rainbow, FruitSalad, Content and Monochrome, each with specific color adjustments. - `TonalPalettes.kt`: Defines the TonalPalettes class, which holds a collection of tonal palettes for different color accents and neutrals, and includes functions for converting colors and ColorScheme objects to tonal palettes.
Adds support for color harmonization and opacity modification within the `AniTrendTheme3` composable. Introduces `harmonizeWith`, `harmonizeWithPrimary`, and `applyOpacity` utility functions for dynamic color adjustments.
498880b
to
47dacb6
Compare
This commit introduces several new composable components for UI elements: - **AniTrendSingleChoiceItem:** A composable for single choice selection with a radio button. - **AniTrendInfo:** A composable to display information with an optional icon. - **AniTrendSwitch:** A switch component with title, description, and optional icon, along with support for custom thumb content. - **AniTrendSwitchVariant:** A switch variant with a larger title and more emphasis. - **AniTrendSwitchWithDivider:** A switch with an optional divider, title, description, and icon, designed to be used as a preference item. - **AniTrendSwitchWithContainer:** A switch enclosed in a container with an optional icon. - **AniTrendMultiSelectChoiceItem:** A composable for multi-selection options with a checkbox. - **AniTrendCautionCard:** A card component for displaying cautionary information with an optional icon. - **AniTrendCategory:** A composable item and header for organizing related items. - **AniTrendHintCard:** A card for displaying helpful hints with an optional icon. These additions provide a set of reusable components for creating various UI layouts and preference screens.
47dacb6
to
1368d81
Compare
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.
Auto approved automated PR
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AniTrend Pull Request
Thank you for contributing! Please take a moment to review our contributing guidelines
to make the process easy and effective for everyone involved.
Please open an issue before embarking on any significant pull request, especially those that
add a new library or change existing tests, otherwise you risk spending a lot of time working
on something that might not end up being merged into the project.
Before opening a pull request, please ensure you've done the following:
develop
and targetsdevelop
(where applicable)Description
Types of changes
IMPORTANT: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the GPL v3 License.