DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:color

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:color [2022-10-19 21:29] – [Update History] 2001:4651:cc3e:0:bcb0:ba79:4fcc:5fb2plugin:color [2024-02-08 08:12] (current) rnck
Line 7: Line 7:
 type       : Syntax type       : Syntax
 lastupdate : 2022-10-19 lastupdate : 2022-10-19
-compatible : 2009-12-25, 2010-11-07, 2011-05-25, 2012-01-25, 2014-05-05, 2014-09-29d, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Detritus,Elenor Of Tsort, Frusterick Manners, Greebo, Hogfather, Igor+compatible : Adora Belle, Weatherwax, Binky, Ponder Stibbons, Detritus, Elenor Of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum, Kaos
 depends    :  depends    : 
 conflicts  conflicts 
Line 34: Line 34:
 <color /#FFff00>text</color> <color /#FFff00>text</color>
 <color rgb(80%,0%,0%)/rgb(100%,80%,100%)>text</color> <color rgb(80%,0%,0%)/rgb(100%,80%,100%)>text</color>
-<color hsl(120,100%,30%)/hsl(180,50%,90%)>text</color>+<color hsl(120,100%,30%):hsl(180,50%,90%)>text</color>
 </code> </code>
  
Line 41: Line 41:
 {{https://folk.ntnu.no/hanche/tmp/dokuwiki_color_plugin.png|Color plugin in action}} {{https://folk.ntnu.no/hanche/tmp/dokuwiki_color_plugin.png|Color plugin in action}}
  
-More precisely, allowed syntax is one of +The foreground or background color specification can be any valid CSS color specification. Beware that some older browsers will not recognise all color specs in the latest CSS version.
-<code> +
-<color ⟨fg-color⟩>⟨text⟩</color+
-<color ⟨fg-color⟩/⟨bg-color⟩>⟨text⟩</color> +
-<color /⟨bg-color⟩>⟨text⟩</color> +
-</code>+
  
-The result is ⟨text⟩ shown with foreground color ⟨fg-color⟩ and background color ⟨bg-color⟩. If either color is omitted or empty, the color of the surrounding text is used.+If you use a color specification that contains a slash (''/'')you must use a colon ('':'') to separate the foreground and background color specs.
  
-Note that the above syntax WILL NOT WORK if one or both color specifications contain a forward slash character (''/'')If that is the case, use a colon ('':''instead. You MUST include the colon in this caseto disambiguate it from the above syntax. Thus, we allow the following syntax:+The precise syntax is as followsSquare brackets (''[]''indicate optional partsand should //not// be included literally:
 <code> <code>
-<color ⟨fg-color⟩:⟨bg-color⟩>⟨text⟩</color>+<color [⟨fg-color⟩][/⟨bg-color⟩]>⟨text⟩</color> 
 +<color [⟨fg-color⟩]:[⟨bg-color⟩]>⟨text⟩</color>
 </code> </code>
-but note that either the foreground or the background color specification may be empty, and hence ignored+You //must// use the second form if either color spec includes a slash
-With the second syntax, the color specifications MUST NOT contain a colon ('':''). +Note that in that case, the colon separater ('':''is mandatory
-We do not know of any CSS color specification that uses colons, so this should be fairly safe – and hopefully future proof.+ 
 +No valid color spec including a colon is known at this time, but if you need to use one in the future, you //must// use the first form. This plugin does not provide a way to combine these. 
 + 
 +The result is ⟨text⟩ shown with foreground color ⟨fg-color⟩ and background color ⟨bg-color⟩. If either color is omitted or empty, the foreground or background color of the surrounding text is used.
  
 Example – note the mandatory colon here: Example – note the mandatory colon here:
  
 <code> <code>
-<color hwb(120 050% / 50%):>some dark green half transparent text</color>+<color hwb(120 2030% / 50%):>some faded dark green semi-transparent text</color>
 </code> </code>
  
-This plugin now allows any color specification not containing single or double quotes or any of the symbols %%< > & ; %%, with the added restrictions regarding slashes and colons described above. It does not try to check if the specification is valid CSS. This is to accommodate the CSS 4 color specifications, as well as any future color specifications – so long as they do not use any of the “forbidden” characters.+Harmless restriction: 
 +This plugin now allows any color specification not containing single or double quotes or any of the symbols ''%%< > & ; %%''. It does not try to check if the specification is valid CSS. This is to accommodate the CSS 4 color specifications, as well as any future color specifications – so long as they do not use any of the “forbidden” characters.
  
 For a reference of usable color specifications, see For a reference of usable color specifications, see
Line 75: Line 75:
   * You cannot use it //inside// headers either, since [[faq:headerlinks|you can't use wiki syntax]] within a header.   * You cannot use it //inside// headers either, since [[faq:headerlinks|you can't use wiki syntax]] within a header.
   * The use of two or more separators (slashes in the first syntax, colons in the second) within %%''<color …>''%% results in undefined behaviour.    * The use of two or more separators (slashes in the first syntax, colons in the second) within %%''<color …>''%% results in undefined behaviour. 
-  * If a future color specification uses slashes in its syntax, the syntax of this plugin will have to be reconsidered.+
 ===== Discussion ===== ===== Discussion =====
  
Line 82: Line 82:
 ===== Development ===== ===== Development =====
  
-Christopher Smith seems to have left the plugin unmaintained. User leeyc0 provided hosting of the plugin on github, but has no time to maintain it either. Harald Hanche-Olsen took over in October 2018. The plugin is considered fairly stable, though, and the new maintainer does not foresee a very active maintenance schedule. New feature requests will likely be rejected.+**Christopher Smith** seems to have left the plugin unmaintained. User **leeyc0** provided hosting of the plugin on github, but has no time to maintain it either. **Harald Hanche-Olsen** took over in October 2018. The plugin is considered fairly stable, though, and the new maintainer does not foresee a very active maintenance schedule. New feature requests will likely be rejected.
  
 ===== Update History ===== ===== Update History =====
plugin/color.1666207792.txt.gz · Last modified: 2022-10-19 21:29 by 2001:4651:cc3e:0:bcb0:ba79:4fcc:5fb2

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki