mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 09:37: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) == "" {
|
if strings.TrimSpace(segment.Color.Value) == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
segmentAlpha := alpha
|
segmentAlpha := mergeAlpha(segment.Color.Alpha, alpha)
|
||||||
if segmentAlpha == nil {
|
|
||||||
segmentAlpha = segment.Color.Alpha
|
|
||||||
}
|
|
||||||
return parseColorWithAlpha(segment.Color.Value, segmentAlpha)
|
return parseColorWithAlpha(segment.Color.Value, segmentAlpha)
|
||||||
}
|
}
|
||||||
return color.Black
|
return color.Black
|
||||||
@@ -280,10 +277,7 @@ func parseShdSegments(segments []ShdSegment, alpha *int) canvas.Grad {
|
|||||||
if strings.TrimSpace(segment.Color.Value) == "" {
|
if strings.TrimSpace(segment.Color.Value) == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
segmentAlpha := alpha
|
segmentAlpha := mergeAlpha(segment.Color.Alpha, alpha)
|
||||||
if segmentAlpha == nil {
|
|
||||||
segmentAlpha = segment.Color.Alpha
|
|
||||||
}
|
|
||||||
gradient.Add(offset, colorToRGBA(parseColorWithAlpha(segment.Color.Value, segmentAlpha)))
|
gradient.Add(offset, colorToRGBA(parseColorWithAlpha(segment.Color.Value, segmentAlpha)))
|
||||||
}
|
}
|
||||||
if len(gradient) == 0 {
|
if len(gradient) == 0 {
|
||||||
|
|||||||
Reference in new issue
Block a user