mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
This commit is contained in:
1 parent
be125d6436
commit
62456ce44d
1 file changed
+2
-8
+2
-8
@@ -243,10 +243,7 @@ func parseShdColor(segments []ShdSegment, alpha *int) color.Color {
|
||||
if strings.TrimSpace(segment.Color.Value) == "" {
|
||||
continue
|
||||
}
|
||||
segmentAlpha := alpha
|
||||
if segmentAlpha == nil {
|
||||
segmentAlpha = segment.Color.Alpha
|
||||
}
|
||||
segmentAlpha := mergeAlpha(segment.Color.Alpha, alpha)
|
||||
return parseColorWithAlpha(segment.Color.Value, segmentAlpha)
|
||||
}
|
||||
return color.Black
|
||||
@@ -280,10 +277,7 @@ func parseShdSegments(segments []ShdSegment, alpha *int) canvas.Grad {
|
||||
if strings.TrimSpace(segment.Color.Value) == "" {
|
||||
continue
|
||||
}
|
||||
segmentAlpha := alpha
|
||||
if segmentAlpha == nil {
|
||||
segmentAlpha = segment.Color.Alpha
|
||||
}
|
||||
segmentAlpha := mergeAlpha(segment.Color.Alpha, alpha)
|
||||
gradient.Add(offset, colorToRGBA(parseColorWithAlpha(segment.Color.Value, segmentAlpha)))
|
||||
}
|
||||
if len(gradient) == 0 {
|
||||
|
||||
Reference in new issue
Block a user