 So I'm Diana, and I'll be talking a little bit about colors. And I'll be talking a little bit about colors. So when I first learned about colors, this was in what, elementary school art class. And I learned, and maybe you did too, that there were three primary colors, red, yellow, and blue, and that you could make any combination of colors from those three. If you mixed red and yellow, you would get orange. If you mixed yellow and blue, you would get green. And if you mixed blue and red, you would get purple. And then you can continue to mix those primary and secondary colors to create everything along the color wheel. But this is not exactly how colors are represented on the computer. On the computer, all the colors are represented by three numbers, as a combination of red, green, and blue lights, usually known as RGB representation. And part of the reason why the computer does this is because that's how monitors work. Each pixel in a monitor has a red, green, and blue light that are then turned on at different values to get each color of the pixel. And so sort of the higher the numeric value for each color, the closer you get to white. And pure white is then a color with maximum values in all three of red, blue, and green lights. And it's not the most intuitive thing in the world, like red and green mixed together gives you yellow, red and blue gives you magenta, and green and blue gives you cyan. And so the way you mix colors together on an RGB representation is usually through linear interpolation, which you can think of as putting the two colors at the ends of a line. So here we have red and blue. And red here is at position zero and blue is at position one. So if you wanted to get any mixture of them at position X somewhere between zero and one, you multiply X by the RGB values of the first color and then one minus X times the RGB values of the second color to get the blend of those two colors at that position. And that is what's used to create gradients in computers. The closer you get to position zero or red, in this case, the more red it is, and the closer you get to one, the more blue it is. And for a lot of colors, this looks pretty good. I don't know how accurate the color representation is on these slides, but red and blue mixed together does make something that resembles purple. And red and yellow makes a color that looks like orange, but sometimes it doesn't work quite as well because of the nature of RGB. When you mix yellow and blue, you get gray. So this is not exactly how mixing paints work, so let's talk about how mixing paints does work. So color actually is the reflection of light off of an object. And the way you perceive color is that all objects reflect certain wavelengths of light and absorb other wavelengths of light. And the wavelengths that are reflected are then picked up by your eye, and if the wavelength is somewhere between roughly 380 nanometers and 750 nanometers, it falls onto the visible light spectrum and you can see it. The shorter the wavelength, the closer you get to violet, and the longer the wavelength, the closer you get to red along the spectrum. You go from violet, blue, cyan, green, yellow, orange, red. So most objects, though, don't reflect a pure wavelength, including paints. So if you have a blue paint, it might reflect mostly light in the blue visible spectrum, but also some violet light and some green light. And similarly, if you have a yellow paint, it will reflect mostly yellow light or light in the yellow wavelength, but also some green and some orange. And so then when you mix those two together, the resulting color of the paint is usually... Hold on, my slide just closed. The resulting color of the paint is usually the color that is reflected by both of the component paints, which in this case would be green, because that's what's in between blue and yellow. And usually the green that's formed is actually a bit darker than the initial colors because the more color you mix together, the less light it can reflect overall, and an object that doesn't reflect any visible light appears black. And so if you eventually mix together all different colors of paint, you end up with something that approaches black. And this is known as subtractive color, where as you continuously add color, it gets darker and darker. And there is a way to represent subtractive color on the computer as well, known as the CMYK color model, which uses cyan, magenta, and yellow as its primary colors. And it's also not the most intuitive thing in the world. You have yellow and magenta making red, yellow and cyan making green, and magenta and cyan making blue. And this is the color format that's often used in printing, because printing is subtractive. You usually start off with a white sheet of paper and then you add inks on it to produce the color. And as much as it's useful for printing, CMYK still doesn't always give you the result that you would get when mixing paints. And this also makes sense in the form of CMYK. Blue is cyan and magenta, and yellow is full magenta. So when you mix them all together, you get black. So now what? How can we get color mixing so that it more accurately represents something that might actually show up in paints? We can try doing other color spaces, since all colors on the computer are just a bunch of numbers that are then translated into pixels somehow. We can try to create a color space that can represent blending between colors really easily. But that will take probably another 10 minutes for me to explain. And also, because a computer uses RGB, you would have to convert them all to RGB to display on screen anyway. So since you can blend paints in real life and have them show up as colors, there's bound to be some sort of physics equation to be able to do that, and then we can simulate that on the computer. And there sort of is. There's an equation called the kubelka monk theory, which was surprisingly un-googlable. There's like 50 different variations of it, of which none of them are very well explained, so I tried my best. But in a nutshell, it returns the reflectance of light for a layer of pigment on a solid surface. That's not a nutshell. So more visually, again, sorry for the people in the back, you have here a layer of pigment, which you can see as this combination of blue and white ink. And then the inputs of the kubelka monk theory, you have white light shining down on this pigment, but we assume that it's on a surface solid enough that the light cannot go through it. And then some other inputs are the physical qualities of this pigment, so like the scattering and the absorption of light, which I don't understand too well, so I'll just leave it at that. And finally, then once you have all these inputs, you can calculate the reflectance of light and figure out what color the light is coming from this layer. And so the kubelka monk theory is actually used in actual art applications. Krita at one point had a painterly color mixer that implemented a variant of the kubelka monk theory to do their color blending. I would have a live demo, but unfortunately, this code was removed in 2012 because it was no longer being maintained, which brings me to a big problem with using the kubelka monk theory is that it's really complicated to implement, and partially because it requires a lot of information about your colors that's not provided by RGB. You need to know how transparent each of your pigments are. You need to know how much light it scatters, how much it absorbs, and that's not given to you based off of your computer code, so you had to make a lot of assumptions. But if you want something that's really physically accurate to a point, it might fail on some edge cases, then the kubelka monk theory is the way to go. But can we do better? We go back to our old arch-nenesis, blue and yellow, which in RGB, as you may recall, gives you gray when you mix them together. But we don't want to make them have gray. We want them to combine and make green. So instead of going straight from blue to yellow, we put green as a midpoint and then linearly interpolate from blue to green and then green to yellow. And already this looks a lot better because blue to green, the linear interpolation gives you something that looks like blueish-green, and then from green to yellow gives you a lighter green. But if we wanted to do even better and have a more accurate teal, we could put even more midpoints and sort of manually hint at where we want this blending to go. And this is great because then you have some points which you know are accurate or you know are what you want, but then you can have the computer interpolate the rest for those in-between points and then you do that for the entire color spectrum. And this is actually the method that is used in the iPad app paper. They went on an apparently year-long journey to try to find the best method to make their color mixer. And actually at some point implemented Kubelka Monk before deciding not to use it because it was too realistic. The problem with color mixing is that sometimes paints don't behave in ways that you expect colors to. We're taught in elementary school that blue and yellow make green, but sometimes paints do that and sometimes they don't. And if you want to have it so that it actually plays to what people's expectations are, they realize that the best way to make things that looked good was to do it all manually. And for a digital art app sometimes you have to trump realistic applications with what looks the best. And on that note, actually I showed you the color wheel at the beginning and claimed this was how colors mixed together. These colors are all chosen manually as well. So yeah, it's just colors are not really intuitive and some things work well and some things don't. So in summary, mixing colors is complicated. And part of that is because color representation in computers is not optimized for blending colors. They just tell you these are the colors that you can show on the computer. This is the relationship between the colors. But in order to mix colors, you can use physics or do it all manually to get realistic or not realistic color blending. Thank you.