Bug 48405 - Implement a color conversion utility
Summary: Implement a color conversion utility
Status: RESOLVED FIXED
Alias: None
Product: XMLGraphicsCommons - Now in Jira
Classification: Unclassified
Component: utilities (show other bugs)
Version: Trunk
Hardware: All All
: P2 enhancement (vote)
Target Milestone: --
Assignee: XML Graphics Project Mailing List
URL:
Keywords:
Depends on:
Blocks: 48237
  Show dependency tree
 
Reported: 2009-12-17 05:57 UTC by Peter Hancock
Modified: 2010-01-08 05:44 UTC (History)
0 users



Attachments
A color coverter interface (1.41 KB, patch)
2009-12-17 05:59 UTC, Peter Hancock
Details | Diff
A ColorConverter interface with some generic implementations (18.44 KB, patch)
2010-01-08 02:30 UTC, Peter Hancock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hancock 2009-12-17 05:57:22 UTC
awt.Color conversion is repetitively re-implemented in the fop code-base. It would be useful to have a common interface for providing this functionality that could be used in the XMLGraphics child projects.
Comment 1 Peter Hancock 2009-12-17 05:59:47 UTC
Created attachment 24724 [details]
A color coverter interface
Comment 2 Chris Bowditch 2010-01-07 06:46:22 UTC
Hi Peter,

I've taken a look at your patch and there are a number of checkstyle warnings about the use of tabs and trailing spaces. If you haven't done so already I suggest you enable checkstyle integration with your Java IDE and check the checkstyle report prior to submitting any patches.

No need to submit a new patch just for checkstyle as I have corrected the checkstyle warnings locally. However, I am wondering why you have placed only the Interface into commons and put the implementations into FOP? Wouldn't it more make sense to put the implementations into commons too. I see they have a dependency on the ColorUtil.toCMYKGrayColor method in FOP, but that could be moved to a super class of ColorUtil that lives in commons. The move should be easy enough as your converter class appears to be the only user of that method.

Chris
Comment 3 Peter Hancock 2010-01-08 02:30:06 UTC
Created attachment 24817 [details]
A ColorConverter interface with some generic implementations
Comment 4 Peter Hancock 2010-01-08 02:32:24 UTC
Updated patch
Comment 5 Chris Bowditch 2010-01-08 05:44:20 UTC
Thanks for the updated Patch Peter. The inclusion of the implementations makes more sense now. Patch committed in revision 897202