[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Commented] (IMAGING-306) Constants in ColorHsv are not in tune with ColorConversions agorith
From:       "Jacob Bra (Jira)" <jira () apache ! org>
Date:       2022-02-28 15:18:00
Message-ID: JIRA.13379020.1621339715000.364211.1646061480052 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/IMAGING-306?page=com.atlassian.jira.plugin \
.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498958#comment-17498958 ] 

Jacob Bra commented on IMAGING-306:
-----------------------------------

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)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic