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

Fixed alpha channel not being respected in colors during HTMLExport #672

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions FastReport.Base/Export/ExportUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,12 @@ internal static string GetExcelFormatSpecifier(FormatBase format, bool useLocale

internal static string HTMLColor(Color color)
{
return ColorTranslator.ToHtml(color);
}

internal static string HTMLColorCode(Color color)
{
return String.Join(String.Empty, new String[] {
"#",
color.R.ToString("X2"),
color.G.ToString("X2"),
color.B.ToString("X2")
});
if (color.A < 255)
{
string alphaValue = (color.A / 255.0).ToString("0.00", INVARIANT_CULTURE);
return $"rgba({color.R}, {color.G}, {color.B}, {alphaValue})";
}
return $"rgb({color.R}, {color.G}, {color.B})";
}

internal static string ByteToHex(byte Byte)
Expand Down