• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating an IndexColorModel with 8 Colours

 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to make an IndexColorModel object with 8 colours: red, green, blue, cyan, magenta, yellow, white, black.

I think the constructor below is the one that I need, but I don't know how to continue. Any help is appreciated.



Thanks.
 
Darryl Burke
Bartender
Posts: 5152
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take it that this is in continuation of http://www.coderanch.com/t/504019/GUI/java/Suggestions-colour-convertor-program and in response to my suggestion there.

Since you apparently didn't feel the need to acknowledge that the suggestion could be useful to you, I don't feel like guiding you further.

To the Bartenders: If you feel this is unduly harsh and violates the principles of BeNice, please feel free to remove it.
 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have updated the above mentioned thread.

The documentation gives these parameter descriptions:

The images that I want to represent using IndexColorModel will be user-selected, so the image dimensions are not fixed. If it makes things much simpler, I can restrict the user to selecting an image of a fixed format, such as only GIF or only JPEG.

The eight colours I want the IndexColorModel to have are: red, green, blue, cyan, magenta, yellow, white, black.

Could anyone please explain what the parameters mean in this case? Then I can try filling them in.

Thanks.
 
Darryl Burke
Bartender
Posts: 5152
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Snippets from the code I used for proof of concept:


 
Mikpo Siru
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! This was the main component in the converter program I was writing, so I have updated that thread: http://www.coderanch.com/t/504019/GUI/java/Suggestions-colour-convertor-program#2277917
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!