Skip to content

Commit

Permalink
Merge pull request #329 from f3dm76/task/opacityRounding
Browse files Browse the repository at this point in the history
Fix  #328: Fill opacity > 1 is processed incorrectly
  • Loading branch information
ystrot authored Apr 23, 2018
2 parents 8ce50ea + 6990c29 commit 48504ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/svg/SVGParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: "")
Expand Down

0 comments on commit 48504ea

Please sign in to comment.