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

[feat]: add option to use a gradient or semi-transparent colours as the cell background #38

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

maxim-petlyuk
Copy link

@maxim-petlyuk maxim-petlyuk commented Nov 7, 2024

[#37]

Add the opportunity to use gradient and semi-transparent colors for cell background

Breaking change:
we have to make surface color as transparent to prevent impact on child composable's color

Surface(
        ...
        color = Color.Transparent,
        contentColor = Color.Unspecified,
        ...
)

How it looks in the code?

  1. If you want to use gradient as a cell background..
OhTeePeeCellConfiguration.withDefaults(
        ...
        cellBackground = OhTeePeeCellBackground.Gradient(
            brush = Brush.linearGradient(
                colors = listOf(Color(0xFFAB5EEE), Color(0xFF4F0995)),
                start = Offset.Zero,
                end = Offset.Infinite,
            ),
            alpha = 0.62f
       )
        ...
)
  1. If you want to use a single color as a cell background
OhTeePeeCellConfiguration.withDefaults(
        ...
        cellBackground = OhTeePeeCellBackground.Solid(backgroundColor.copy(alpha = 0.6f))
        ...
)

Reference how it may look with gradient colors:
Ray Romano saying What do you think?

@maxim-petlyuk maxim-petlyuk changed the title Feature/gradient cell background feat: add option to use a gradient or semi-transparent colours as the cell background Nov 7, 2024
@maxim-petlyuk maxim-petlyuk changed the title feat: add option to use a gradient or semi-transparent colours as the cell background [feat]: add option to use a gradient or semi-transparent colours as the cell background Nov 7, 2024
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.

1 participant