Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output hex color value for transparent values if UseHex is true #132

Closed
mganss opened this issue Jan 31, 2023 · 1 comment
Closed

Output hex color value for transparent values if UseHex is true #132

mganss opened this issue Jan 31, 2023 · 1 comment
Milestone

Comments

@mganss
Copy link
Contributor

mganss commented Jan 31, 2023

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.

@FlorianRappl FlorianRappl added this to the v1.0 milestone Jun 14, 2023
@FlorianRappl
Copy link
Contributor

Implemented and available in next preview / 1.0.0.

FlorianRappl added a commit that referenced this issue Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants