How do our brains actually transform the information that the cones in our eyes receive into the different colors that we can see and imagine?
Despite its simplicity, this question demands a so complex answer that we can start by saying:
We still don't know.
Because you are talking about the colour as a sensation, as something that I feel and that I (literally) see. And here is the problem: as such, the "colour" is not a physical reality.
Some people may disagree here, but colour is not a physical property of any material. Light is a physical property. The wavelength, the energy, the frequency of light are all physical properties. Even the crazy quantum nature of the photon with its restless existence is a physical property. But not colour. Colours are creations of my mind, my nervous system, my idiosyncratic consciousness.
For instance, It's simply impossible to know if the red that I see in my mind is the same red that you see in your mind. The fact that we both call it "red" or the fact that we both agree that the colour of the blood is the same colour of the wine doesn't help at all: this is a problem of qualia:
And the same goes for all other conscious experiences derived from the exteroceptors, such as "taste" and "sound". What I feel is particular and nothing can guarantee that another person feels the same, even if the stimuli are the same and the nervous impulse to the CNS are the same.
To finish, I'd like to propose a thought experiment, for you to understand the subjective nature of the colour:
We tend to imagine that the world is the way we see it (as primates, we value the vision very much). But we have only 3 different cones, giving us roughly 1 million (100$^3$) different colours. Reptiles, as the birds, have 4 different cones, and some of those reptiles, as pigeons, have 5 different cones, giving them the ability to "see" 10 billion colours (100$^5$). This is hypothetical, of course, to really perceive all these colours the animal needs a huge brain cortex, but let's suppose that they see (perceive) all these 10 billion colours.
Now try to imagine these 10 billion colours, you, who are an organism that only perceives 1 million colours. It's impossible. And it's impossible for a talking pigeon to explain to you how he/she sees the world, how all these 10 billion colours are, the same way that it's impossible for you to explain to an animal with achromatic vision what is green, purple, orange, cyan, magenta etc...
This is what we call qualia.
But, as someone that loves cognitive ethology and science in general, I don't think that this is something beyond the realm of sciences, something impossible to know... this is a problem that can be scientifically addressed and, with the ingenuity of the neuroscientists and other biologists, we can someday understand the "redness" nature of the red we see.