In this feature, I will introduce a new product or project I am designing. Here, I will introduce CSS Colorizer (name pending), a webapp to ease the process of selecting color schemes. I know there are plenty of other programs out there with similar intentions, but I think this one has a few differences.
The problem with selecting colors for CSS is that there’s no way to keep color values consistant. Any color scheme change requires multiple changes throughout the style sheet. And they’re not always straight-forward find-and-replace changes.
If you change a link color, for example, you’ll have to change the hover color, the visited color, and any matching colors.
This program will fix that by replacing color values with variables and establishing relations between them. So you can create a color, background, and assign it a value. Then, create another color, headerbackground, and define it as a brighter version of background. Then, whenever you change background, headerbackground is automatically changed and propagated throughout the style sheet.
The interface will consist of a color pane, a CSS pane, and a preview pane. Start by loading a style sheet into the CSS pane, then replace the color values with variables, like $$background. Once you’ve done that, start creating the colors.
Colors can be either base colors or derived colors. Base colors are given an actual RGB value, just like tradition. There will be sliders, input boxes, and a color wheel for selection. Derived colors are a function of base colors and other derived colors. There will be methods like hueshift(), green(), and complement() to give a variety of ways to define colors.
Each color will have a preview swatch which is automatically updated whenever any color changes. So, if you modify a base color, all derived color changes will be reflected.
For the preview pane, I’m considering two options: an actual HTML file using the style sheet or a set of selectable matching patterns.
Saving will inject the actual color values back into the CSS file and write all color information into a comment header so it can be reloaded. Since all loading and saving will be client-side, this will be purely HTML and javascript.
Update: I forgot that javascript give you any way to read files (huge security hole). So, I have two other options of getting CSS into the app: Ajax and manual insertion. I would like the option of a pure client-side app so I’ll give the option of manual loading (paste into the textarea). Adding Ajax would not be a large task, but it’s not a priority either so I am making no plans to use it.