I want to make custom GUI object that looks just like a color spectrum . but this color spectrum should be interactive so when a user clicks on any point of that spectrum , the code will relate that point or coordinate of the color spectrum rectangle ,to the rgb value of color of the clicked point.
the range of the spectrum should be from zero to the maximum possible rgb value (the professor has said to make it from zero to 255^3 which I think is incorrect as 3 can be different colors ) then the range of the the colors should be relate and scaled to the number of pixels the longer side of the rectangle . the clicking part is done by mouse listeners that I've used before but I don't know how to make it to react to several clicks .
so how can I make this object ? also I don't want to use JColorchooser .