WikiStyleColors-Talk
On PmWiki.WikiStyleColors the section shows
> How do admins define colors for all pages?? Define color keywords and rely on
> the browser to render the color values. You can use the color keywords for both
> text color (use text) and also background color (use text).
> Add to your local configuration file:
>
>$SVGColors = array (
> ...
This is only showing 140 colornames. Modern browsers support 148 colornames.
Missing:
- darkgray (You have darkgrey)
- darkslategrey (You have darkslategray)
- dimgrey (You have dimgray)
- grey (You have gray)
- lightgray (You have lightgrey)
- lightslategrey (You have lightslategray)
- slategrey (You have slategray)
- rebeccapurple (Last color added to the official CSS spec in 2014)
In addition there is a typo. Browsers do not recognize "peachbuff". The correct name is "peachpuff".
Here is the corrected code:
$SVGColors = array(
'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque',
'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue',
'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',
'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgrey', 'darkgreen',
'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred',
'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey',
'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',
'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro',
'ghostwhite', 'gold', 'goldenrod', 'gray', 'grey', 'green', 'greenyellow',
'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender',
'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan',
'lightgoldenrodyellow', 'lightgray', 'lightgrey', 'lightgreen', 'lightpink',
'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey',
'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', 'peachpuff', 'peru',
'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown',
'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell',
'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise',
'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen'
);
IMHO this should not be something that "admins define colors for all pages" ... and "add to your local configuration file".
This should be added to the core of PmWiki.
--gnuzoo
Added 'rebeccapurple'. The CSS standard has both the English language 'grey' and the American dialect 'gray' variants with the same color codes, added these as well. I agree nobody should define that many colors or use that many, especially in unsafe-inline styles. One should use semantic CSS class names like "frame", "note", "info", "success", "danger", "warning", for several reasons: to avoid unsafe-inline styles and possible security vulnerabilities; to reduce the complexity of wiki source texts; to reduce the chaos of multiplying inappropriate colors; to allow adaptation of the colors for different skins; to allow for adaptation of the colors for the dark themes. FYI core WikiStyles that inject unsafe-inline CSS are planned for migration to CSS class names; adding new unsafe-inline styles should be expected at the lowest priority -- but feel free to add a PITS feature request to evaluate if there is community need and support for this. Petko
I copied and pasted what was already on the main page and corrected some names.
I did not look at the variable $SVGColors. Clearly SVG files have security issues.
When I said this should be in the core, I meant so they could be used
in style markup between percent signs like "%red%."
Example of color name use in markup box:
%red%This text is the the color red.%% %rebeccapurple%I wanted this text to be the color rebeccapurple, but it is not.%% |
This text is the the color red. I wanted this text to be the color rebeccapurple, but it is not. |
I do not want to add a security issue. I wanted more style color names.
Please educate me if my intent is a security issue.
--gnuzoo
Read my message again, and the external reference I added. If you want to see this in the named color, use %color=rebeccapurple%, or enable the documented definitions yourself. Petko
I did an include (:include WikiStyleColors#CSSColors#CSSColorsEnd:) in page WikiStylesPlus because it was the old color list and used "$SVGColors".
The only other place I saw that had $SVGColors was PmWikiDe/WikiStyleColors and I do not speak German.
--gnuzoo
How would I change my wiki to have "off-wiki" links in a different color?
For exanmple, I'd like to work "in the wiki" and be "warned" (by color) that a link was going to "close" the wiki, and go offsite.
Alternatively, I'd like all off-wiki links to automatically open in a new tab.
I think ending with "?target=_blank" or something like that is supposed to work - but would be nice if a user's link with just the usual notation, would automatically open a new page.
Thanks! Ward Christensen
Answers:
This is a talk page for improving PmWiki.WikiStyleColors.