This would be on a per-project or per-drawing-file basis, an external file that could be shared by a web or graphic design project, much like a separate (external) .css file may be used.
Actually, I wish CSS could offer this. IMHO, it would be a boon to future CSS and SVG.
I envision that as something like:
Code: Select all
// note -pseudocode- prefix;
// "big-project" is a domain specifier to delimit scope of usage.
// Thus, used elsewhere as: big-project:Orange, big-project:Brown, and so on.
// The designer may assign whatever color-list identifier (name) and color-def name he/she wishes.
// By default, the CSS3 and SVG 1.1 named colors would have a prefix of css3, but that would be ~assumed~ (not required to use the css3:color-name prefix) for backward compatibility.
// CMYK color model would be highly useful for in-print design work, but is not in CSS3 or SVG 1.1; It has been included here with a "-" prefix.
-pseudocode-color-list("big-project") {
-pseduocode-color-def: #ff8000 rgb( 255, 128, 0 ) hsl( 30, 100, 50 ) -pseudocode-cmyk( 0, 50, 100, 0 ) "Orange";
-pseduocode-color-def: #804000 rgb( 128, 64, 0 ) hsl( 30, 100, 25 ) -pseudocode-cmyk( 0, 50, 100, 50 ) "Brown";
// lots of other named colors to suit the needs of the given project;
} // -pseudocode-color-list("big-project");
Thereafter, a designer could refer within the CSS or SVG to that color by name, such as:
Code: Select all
.foo {
background: transparent;
color: big-project:Orange;
}
Admittedly, that may seem like a trivial usage. But remember, your project might have tens or hundreds of uses of big-project:Orange for various reasons. Add in a whole palette of colors for particular, sensible, meaningful uses within a site full of pages and images (in SVG, PNG, and so on) and suddenly, the ability to refer to big-project:Orange by a human-friendly and human-meaningful name is not so trivial.
I suppose a way to alias a color definition to one or more alias names would be useful too. Imagine uses like big-project:highlight-back, big-project:highlight-fore, big-project:sidebar-stop-3, big-project:main-accent, and so on;