Skip to content
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 4 commits into from
Mar 8, 2025

Conversation

wax911
Copy link
Member

@wax911 wax911 commented Mar 6, 2025

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:

  • You have followed our contributing guidelines
  • Double checked that your branch is based on develop and targets develop (where applicable)
  • Pull request has tests (if applicable)
  • Documentation is updated (if necessary)
  • Description explains the issue/use-case resolved

Description

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (Improves existing functionality)

IMPORTANT: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the GPL v3 License.

@github-actions github-actions bot added the 🌟 feature A new feature label Mar 6, 2025
@wax911 wax911 force-pushed the feature/compose-settings-refinement branch from 6f4b8cd to 42a8d0f Compare March 6, 2025 20:43
wax911 added 3 commits March 8, 2025 17:03
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.
@wax911 wax911 force-pushed the feature/compose-settings-refinement branch 2 times, most recently from 498880b to 47dacb6 Compare March 8, 2025 15:05
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.
@wax911 wax911 force-pushed the feature/compose-settings-refinement branch from 47dacb6 to 1368d81 Compare March 8, 2025 16:13
Copy link

@github-actions github-actions bot left a 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

@wax911 wax911 enabled auto-merge (rebase) March 8, 2025 16:14
@wax911 wax911 merged commit 7e189f5 into develop Mar 8, 2025
10 of 11 checks passed
@wax911 wax911 deleted the feature/compose-settings-refinement branch March 8, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 feature A new feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant