Skip to content

Color.GetHue value return different value based on framework in WPF platform #11293

@SubashiniMahendran

Description

@SubashiniMahendran

Description

I created an application that includes a ColorHelper class which computes a color value for a SolidColorBrush based on its opacity. However, calling Color.GetHue returns slightly different values depending on the target framework (for example, .NET Framework 4.6.2 vs .NET Core), so the resulting color differs between builds. Please see the attached screenshot and sample project for reference.

wpf-462-project.zip
wpf-netcore-project.zip

Image Image

Reproduction Steps

Run the attached net462 and netcore samples.
Note the color value different in both sample due to Color.GetHue value.

Expected behavior

Should return same color value for both 462 and netcore framework in Color.GetHue method.

Actual behavior

Return different color value for 462 and netcore framework in Color.GetHue method.

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions