Skip to content

RGB to HSL calculation is incorrect (Saturation value) #997

@mgkeeley

Description

@mgkeeley

The saturation calulation for RGB to HSL has a small bug.
On line HslAndRgbConverter.cs#L99


the calculation should be
s = chroma / (2F - max - min);

(Looks like an optimization mistake: chroma=max-min, but 2F-max-min is not 2F-chroma)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions