Currently, when UseHex is true, color values are output as hex only if alpha is 1.0.
|
/// <summary> |
|
/// Gets or sets if hex codes should be used for serialization. |
|
/// This will not be applied in case of transparent colors, i.e., |
|
/// when alpha is not 1. |
|
/// </summary> |
|
public static Boolean UseHex { get; set; } |
|
else if (_alpha == 255 && UseHex) |
|
{ |
|
return $"#{_red.ToString("X2", CultureInfo.InvariantCulture)}{_green.ToString("X2", CultureInfo.InvariantCulture)}{_blue.ToString("X2", CultureInfo.InvariantCulture)}"; |
|
} |
Perhaps this could be changed to include colors with alpha < 1.0, too.
Currently, when
UseHexis true, color values are output as hex only if alpha is 1.0.AngleSharp.Css/src/AngleSharp.Css/Values/Primitives/Color.cs
Lines 376 to 381 in 15deaee
AngleSharp.Css/src/AngleSharp.Css/Values/Primitives/Color.cs
Lines 398 to 401 in 15deaee
Perhaps this could be changed to include colors with alpha < 1.0, too.