We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 037d6ea commit d7709eeCopy full SHA for d7709ee
1 file changed
src/ImageSharp/Color/Color.cs
@@ -251,7 +251,17 @@ public Color WithAlpha(float alpha)
251
/// </summary>
252
/// <returns>A hexadecimal string representation of the value.</returns>
253
[MethodImpl(InliningOptions.ShortMethod)]
254
- public string ToHex() => this.data.ToRgba32().ToHex();
+ public string ToHex()
255
+ {
256
+ if (this.boxedHighPrecisionPixel is not null)
257
258
+ Rgba32 rgba = default;
259
+ this.boxedHighPrecisionPixel.ToRgba32(ref rgba);
260
+ return rgba.ToHex();
261
+ }
262
+
263
+ return this.data.ToRgba32().ToHex();
264
265
266
/// <inheritdoc />
267
public override string ToString() => this.ToHex();
0 commit comments