Closed kishanbh closed 3 years ago
With some modification, it's possible to apple gradient color to Slice's background. I add this in the future release. However, if you need a fast solution, here is a file that updated for gradient:
About Text gradient, unfortunately, there is no easy solution.
@sh-khashimov can we apply gradient-like marked (radial gradient) in the attached image for the slice and applying for some slice only not all slice in the wheel?
@sh-khashimov do you have any suggestions or thoughts about radial gradient for slice then it will be helpful.
change the code above that I gave you to:
context.drawLinearGradient(
gradient,
start: CGPoint(x: path.boundingBox.minX, y: path.boundingBox.midY),
end: CGPoint(x: path.boundingBox.maxX, y: path.boundingBox.midY),
options: []
)
//MARK: - Gradient Color END
@sh-khashimov thanks for the reply but it gives a gradient but from bottom to top like in between colors straight line I want radial like orange marked in the attached image is it possible?
instead of context.drawLinearGradient
:
context.drawRadialGradient(gradient,
startCenter: center,
startRadius: 0,
endCenter: center,
endRadius: radius,
options: [])
@sh-khashimov got it, thanks for the reply and library. do you have any idea about the slice's text gradient or any file modification?
Unfortunately, no. Since gradient text is just an image inside the text, which adds complexity for already not an easy text processing inside the SwiftFortuneWheel
. If you need to add a gradient text, my current advice, convert text to an image with gradient applied text, then add that image to your Slice.
@sh-khashimov thanks for the replay and all your help. Hope, in future version, we have gradient color option for text also
With some modification, it's possible to apple gradient color to Slice's background. I add this in the future release. However, if you need a fast solution, here is a file that updated for gradient:
SliceDrawing.swift.zip
About Text gradient, unfortunately, there is no easy solution.