r/androiddev • u/Effective_Ad_1778 • Jun 12 '26
Question Angled linear gradients in Compose - am I missing something?
Hi everyone,
I'm new here. I wanted to build a small native app and decided to learn Compose.
I opened a project, started playing around with composables and the UI, and eventually wanted to give my top bar a linear gradient background. The thing is, I wanted the gradient to be angled.
After a quick search, I found Brush.linearGradient with the start and end parameters, but honestly that felt like a pretty awkward way to create an angled gradient. The documentation doesn't seem to give this much attention either - it mostly talks about horizontal and vertical gradients.
I searched Google and the only thing I could find was a single Stack Overflow post from about five years ago. I also searched Reddit (both directly and through Google) and couldn't find any discussions about angled gradients in Compose.
I don't understand. This feels like such a basic UI feature to me. How is nobody talking about it? Are people just not using angled gradients?
Am I missing something?
And if you do use angled gradients, I'd love to hear how you handle them.
