1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-11-11 01:42:35 +03:00

Merge pull request #329 from f3dm76/task/opacityRounding

Fix  #328: Fill opacity > 1 is processed incorrectly
This commit is contained in:
Yuri Strot 2018-04-23 20:07:28 +07:00 committed by GitHub
commit 48504ea7e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -531,6 +531,7 @@ open class SVGParser {
}
fileprivate func createColor(_ hexString: String, opacity: Double = 1) -> Color {
let opacity = min(max(opacity, 0), 1)
var cleanedHexString = hexString
if hexString.hasPrefix("#") {
cleanedHexString = hexString.replacingOccurrences(of: "#", with: "")