[pmwiki-users] Request to extend Wiki Styles colors

Hans design5 at softflow.co.uk
Fri Mar 14 08:15:48 CDT 2008


I noticed that scripts/wikistyles.php does not support all the HTML4
color keywords.

Can this:

    foreach(array('black','white','red','yellow','blue','gray',
      'silver','maroon','green','navy','purple') as $c)
    SDV($WikiStyle[$c]['color'],$c);

be changed to this:

  foreach(array('black','gray','silver','white','maroon','red','purple','fuchsia',
                'green','lime','olive','yellow','navy','blue','teal','aqua') as $c)
    SDV($WikiStyle[$c]['color'],$c);

adding fuchsia, lime, olive, teal, aqua, which are standard HTML4
color keywords.


I also wonder if wsplus.php http://www.pmwiki.org/wiki/Cookbook/WikiStylesPlus
can be extended with all the SVG color keywords, which modern
browsers do support. I suggest to add this to the script:

$SVGColors = array (
'aliceblue','antiqewhite','aqua','aquamarine','azure','beige','bisque','black',
'blanchedalmond','blue','blueviolet','brown','burlywood','cadetblue','chartreuse','chocolate',
'coral','cornflowerblue','cornsilk','crimson','cyan','darkblue','darkcyan','darkgoldenrod',
'darkgrey','darkgreen','darkkhaki','darkmagenta','darkolivegreen','darkorange','darkorchid','darkred',
'darksalmon','darkseagreen','darkslateblue','darkslategray','darkturqoise','darkviolet','deeppink','deepskyblue',
'dimgray','dodgerblue','firebrick','floralwhite','forestgreen','fuchsia','gainsboro','ghostwhite',
'gold','goldenrod','gray','green','greenyellow','honeydew','hotpink','indianred',
'indigo','ivory','khaki','lavender','lavenderblush','lawngreen','lemonchiffon','lightblue',
'lightcoral','lightcyan','lightgoldenrodyellow','lightgreen','lightgrey','lightpink','lightsalmon','lightseagreen',
'lightskyblue','lightslategray','lightsteelblue','lightyellow','lime','limegreen','linen','magenta',
'maroon','mediumaquamarine','mediumblue','mediumorchid','mediumpurple','mediumseagreen','mediumslateblue','mediumspringgreen',
'mediumturquoise','mediumvioletred','midnightblue','mintcream','mistyrose','moccasin','navajowhite','navy',
'oldlace','olive','olivedrab','orange','orangered','orchid','palegoldenrod','palegreen',
'paleturquoise','palevioletred','papayawhip','peachbuff','peru','pink','plum','powderblue',
'purple','red','rosybrown','royalblue','saddlebrown','salmon','sandybrown','seagreen',
'seashell','sienna','silver','skyblue','slateblue','slategray','snow','springgreen',
'steelblue','tan','teal','thistle','tomato','turquoise','violet','wheat',
'white','whitesmoke','yellow','yellowgreen'
);
foreach($SVGColors as $c)
   $WikiStyle[$c]['color'] = $c;


All these color keywords can then be used as keywords for text
colors, and as background colors using bgcolor=keyword.

See http://www.w3.org/TR/css3-color/ for HTML4 color keywords and for
SVG color keywords.


  ~Hans   




More information about the pmwiki-users mailing list