From: Allen D. <da...@cs...> - 2001-08-17 14:30:34
|
> The single suggestion I have for the moment would be to change the namespace. > CSS.pm would normally be reserved for the base class, or all encompassing > system, or something like that, relating to CSS. That's why there is no > XML.pm for instace, because none of the modules there are generic enough > (though there may be one at some point). I'll see if I can come up with something more appropriate. > Sorry for being thick, but I'm still not sure I understand what it does > correctly. Could you provide an example ? Say you have an array of text that represents a 1-dimensional series, and you want some of that series to be highlighted yellow. You can just put <SPAN> tags around the text, and get your yellow highlighting by defining the class (or id) of the tag. ---------------- <-- highlight section ATCGTTAACTAGACCTAACTTGGGCCTAAACGATACCCCCTTGGAACAAAAA <-- whole series Now say you have a GD image, and you want to draw a line that represents this same series, with the same part in yellow, and the rest black. Calculating which part of the line should be a different color is just arithmetic. To make the yellow section yellow, you have to do something like: $fg = GD->color(255,255,0); GD->line($x1,$y1,$x2,$y2,$fg); What my module allows you to do is configure this in my.css as: .highlight { background-color: yellow; } and then do something more flexible, like: $css = CSS->new(-source=>'my.css'); $fg = GD->color($css->style('.highlight'); GD->line($x1,$y1,$x2,$y2,$fg); and still obtain the same result. -Allen __________________ Allen Day all...@cs... 1.516.367.6904 |