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

Add initialColor to AlphaSlider #37

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

yangsooplus
Copy link
Contributor

🎯 Goal

I have applied the initialColor to AlphaSlider, just like HsvColorPicker and BrightnessSlider, allowing you to set the initial alpha value.

🛠 Implementation details

I have implemented initialColor parameter and isInitialized flag in the same format as HsvColorPicker and BrightnessSlider.

Additionally, I have updated a portion of the initialColor description in BrightnessSlider:
it will be selected on center if you give null value.
➡️ it will be selected on the rightmost of the slider if you give a null value.

✍️ Explain examples

You can initialize the Color by passing it as the initialColor parameter, just like in HsvColorPicker and BrightnessSlider.

 AlphaSlider(
            modifier = Modifier
                .fillMaxWidth()
                .padding(10.dp)
                .height(35.dp)
                .align(Alignment.CenterHorizontally),
            controller = controller,
            initialColor = Color.Transparent,
        )

In the process of repeatedly selecting colors through a dialog that includes AlphaSlider, I have noticed that the alpha value resets, causing inconvenience. I would like to propose a modification to address this issue. I would like to express my gratitude for using your cool library in my personal project. 👍

Copy link
Owner

@skydoves skydoves left a comment

Choose a reason for hiding this comment

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

Looks great to me. Thank you for your contribution!

@skydoves
Copy link
Owner

Would you run the ./gradlew apiDump command before merging this PR?

@yangsooplus yangsooplus force-pushed the feature/alphaslider-initial-color branch from 892d030 to dda732b Compare September 11, 2023 06:18
@yangsooplus yangsooplus force-pushed the feature/alphaslider-initial-color branch from dda732b to b2d1d6f Compare September 11, 2023 06:24
@yangsooplus
Copy link
Contributor Author

Sorry 😅 Now I run that command

@skydoves skydoves merged commit f4d2422 into skydoves:main Sep 13, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants