This class is roughly based on the one I found on Bob Powell’s website, however I had to change the HSL formulas (for some reason, Adobe Photoshop doesn’t convert the way everyone else does), and I had to add my own CMYK functions. ![]() To help me convert color values, I have created my AdobeColors class. ![]() ![]() For those of you who will want to use this project on one of your own, you can just change the visibility of the Lab text boxes and labels to false. Eventually, I’d also like to find a formula for Lab values as well, but for now I leave those boxes disabled on the color picker form. The key to making this project successful is to have a way of converting between RGB, HSL, and CMYK values. This combination of values allows you to easily find those in-between colors (like red-orange or whatever) and then adjust how bright or colorful they are.ĬMYK values, which is short for cyan/magenta/yellow/black, are used more in printing applications, where balancing how much ink is used for a project is very important. Hue represents all 360 degrees of the color wheel, saturation represents how much color is shown, and Luminance describes how dark the color is. This is also sometimes referred to as HSB (B for Brightness). For the artists, you’ll usually find some type of HSL (Hue, Saturation, and Luminance) representation. Normally, each RGB value is stored (in the case of a 24-bit bitmap) from 0 – 255, which allows you to have a maximum of over 16 million colors.įor a programmer, this is just fine, but for most artists, there are better ways to display a color graph. A color can be represented in many different ways, one of the most popular being RGB or Red Green Blue. Colors: RGB, HSL, and CMYK What Are These Formats?įor those of you who know what these are, you can probably skip this section. Also, I try to keep my variable names descriptive, and all class member variables carry the prefix ‘ m_’ followed by ‘ i’, ‘ b’, ‘ sz’ for integers, booleans and strings. I know for me, this makes it easier to find the methods I’m looking for when debugging, without having to scroll down twenty or thirty functions to find what I need to fix. I love dividing my code into regions, and you’ll notice that all my classes have Variables, Constructors/Destructors, Events, Public Methods and Private Methods section. I won’t go into my code in too much depth in this article for the sake of space and readability, but for those of you who do download and look at the code, I’d like to briefly talk about my naming conventions and programming style. ![]() While these controls do the job very well, I being a fan of Adobe Photoshop, found them to be lacking in options, or in the case of the existing projects here just not quite what I wanted to use for my project. NET Framework, and even better than those are a couple color pickers that can be found right here on the Code Project. I’ll begin by saying that I know there are built-in color dialog boxes included with the. NET controls that behave like the color picker controls usually found in the most recent versions of Adobe Photoshop. This is the first article of a two part series I’m working on, showing some. Introduction Why Another Color Picker Control?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |