Showing posts with label Color::Declarative. Show all posts
Showing posts with label Color::Declarative. Show all posts

Tuesday, January 13, 2015

Color

I don't know why this kind of database always interests me.

Saturday, October 9, 2010

Further thoughts on Color::Declarative

The basic object in Color::Declarative is, of course, the color:
color green
or
color (SVG) blue
There is also a dictionary object to create custom dictionaries:
color-dictionary my-palette
If we're not using a custom dictionary, then we use Color::Library for named dictionaries, and the default there is the SVG dictionary as a kind of general catchall.

We can also define a whole new custom color from scratch like this:
color my-green #00ff02
But we're not normally going to do this. Instead, normally we'll define a color by its function:
color button-color (SVG) green
Then we can use it elsewhere. And we can do that for a whole set of colors like this:
color-dictionary my-palette
button (SVG) green
titlebar (SVG) blue
Then we can define a button something like this:
button fahrenheit (x=130, y=50, color=button) "Fahrenheit"
We could also imagine a palette defined something like:
color-dictionary
primary (SVG) { $retrieved_value }
secondary (SVG) primary.complement
I don't like that poorly considered syntax, but the point is that we should be able to build sophisticated palettes based on functional relationships.

Sunday, August 8, 2010

Color::Declarative

Since colors and their names come up with astonishing regularity in graphics (PDF, SWF, Wx, etc.) I've decided I need a common set of semantics. Exactly what that means is still a little underspecified, but it's important.

Color::Library - support for all kinds of existing color libraries/naming schemes

Graphics::ColorNames - general support for color naming

Other things to do with colors, maybe: Color::Mix, tools for Color::Schemes, and ... well, a CPAN search on color would probably find others.

The semantics of color are pretty neat, although a lot of it is symbols without referents for me. It might be interesting to make this class the first that really starts to be a semantic class.