Skip to content

Commit 5796097

Browse files
committed
Change pixel conversion.
1 parent 3368bf9 commit 5796097

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/ImageSharp.Drawing/Processing/PathGradientBrush.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ public PathGradientBrushApplicator(
280280
Vector4 pointColor = ((1 - u - v) * this.edges[0].StartColor) + (u * this.edges[0].EndColor) +
281281
(v * this.edges[2].StartColor);
282282

283-
return new Color(pointColor).ToPixel<TPixel>();
283+
TPixel px = default;
284+
px.FromVector4(pointColor);
285+
return px;
284286
}
285287

286288
var direction = Vector2.Normalize(point - this.center);
@@ -301,7 +303,9 @@ public PathGradientBrushApplicator(
301303

302304
var color = Vector4.Lerp(edgeColor, this.centerColor, ratio);
303305

304-
return new Color(color).ToPixel<TPixel>();
306+
TPixel pixel = default;
307+
pixel.FromVector4(color);
308+
return pixel;
305309
}
306310
}
307311

0 commit comments

Comments
 (0)