Fill by gradients not supported
See original GitHub issueHi, In the beginning, thx for the cool converter. I discovered filling color is null if used any gradient. For example, you can take this SVG and convert it to kt
<svg height="150" width="400">
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" />
<stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" />
</linearGradient>
</defs>
<ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)" />
</svg>
public val ImagesGroup.Gradient: ImageVector
get() {
if (_gradient != null) {
return _gradient!!
}
_gradient = Builder(
name = "Gradient", defaultWidth = 400.0.dp, defaultHeight = 150.0.dp,
viewportWidth = 400.0f, viewportHeight = 150.0f
).apply {
path(
fill = null,
/* expected
Brush.linearGradient(
colors = listOf(Color.Yellow, Color.Red),
start = Offset(0f, 0f),
end = Offset(Float.POSITIVE_INFINITY, 0f)
),
*/
stroke = null,
strokeLineWidth = 0.0f,
strokeLineCap = Butt,
strokeLineJoin = Miter,
strokeLineMiter = 4.0f,
pathFillType = NonZero
) {
moveTo(115.0f, 70.0f)
arcToRelative(85.0f, 55.0f, 0.0f, true, false, 170.0f, 0.0f)
arcToRelative(85.0f, 55.0f, 0.0f, true, false, -170.0f, 0.0f)
close()
}
}
.build()
return _gradient!!
}
private var _gradient: ImageVector? = null
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Re: Gradients not working on Text - Adobe Support Community
Go to the Appearance panel and add a new fill. Change it to a gradient and make sure it is above the Characters...
Read more >Gradient tool in Adobe Illustrator not working - YouTube
Update: I figured it out, the circle shape was (for some reason) having issues (even after "expanding" or making it a compound shape),...
Read more >ggplot gradient fill not working - Stack Overflow
1 Answer 1 ... The gradient fill is correct. It's the text values that are incorrect. Note, for example, in the data below...
Read more >Gradient fill in Page fill not working correctly
I'm having a problem with the gradient effect. I have everything set up properly. Everything prints properly yet when I try to use...
Read more >Gradient fill dosen't work · Issue #502 · airbnb/lottie-web - GitHub
Hi, I just made a simple shape layer with gradient fill for test. But it doesn't work properly. It just showed black &...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The PR was merged, thank both @MarioFerreiraStorytel @jershell
@jershell I’ve created a pull request for this: https://github.com/DevSrSouza/svg-to-compose/pull/6