You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jacob Bra (Jira)" <ji...@apache.org> on 2022/02/28 15:18:00 UTC
[jira] [Comment Edited] (IMAGING-306) Constants in ColorHsv are not in tune with ColorConversions agorithms
[ https://issues.apache.org/jira/browse/IMAGING-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498958#comment-17498958 ]
Jacob Bra edited comment on IMAGING-306 at 2/28/22, 3:17 PM:
-------------------------------------------------------------
I was thinking of working on this issue as part of a school project.
was (Author: JIRAUSER285898):
I was thinking of working on this issue.
> Constants in ColorHsv are not in tune with ColorConversions agorithms
> ----------------------------------------------------------------------
>
> Key: IMAGING-306
> URL: https://issues.apache.org/jira/browse/IMAGING-306
> Project: Commons Imaging
> Issue Type: Bug
> Components: imaging.color.*
> Affects Versions: 1.0-alpha2
> Reporter: Julien NICOL
> Priority: Major
>
> ColorHsv.BLUE, ColorHsv.RED, ..., constants are defined in the ranges 0-360 (for hue) and 0-100 (for brightness & value).
>
> However methods in ColorConversions expect ranges 0-1 everywhere.
>
> Documentation should be clearer and the API consistent.
>
> The following assertions are in failure:
> assertEquals(Color.BLUE, new Color((ColorConversions.convertHSVtoRGB(ColorHsv.BLUE))));
> assertEquals(ColorHsv.BLUE, ColorConversions.convertRGBtoHSV(Color.BLUE.getRGB()));
>
> The following assertions are OK:
> assertEquals(Color.BLUE, new Color((ColorConversions.convertHSVtoRGB(ColorHsv.BLUE.H / 360.0,
> ColorHsv.BLUE.S / 100.0, ColorHsv.BLUE.V / 100.0))));
> assertEquals(new ColorHsv(ColorHsv.BLUE.H / 360.0, ColorHsv.BLUE.S / 100.0, ColorHsv.BLUE.V / 100.0), ColorConversions.convertRGBtoHSV(Color.BLUE.getRGB()));
--
This message was sent by Atlassian Jira
(v8.20.1#820001)