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 [2018-10-12 20:16] – [Usage] Some updates hancheplugin:color [2024-02-08 08:12] (current) rnck
Line 6: Line 6:
 email      : harald.hanche-olsen@ntnu.no email      : harald.hanche-olsen@ntnu.no
 type       : Syntax type       : Syntax
-lastupdate : 2018-10-12 +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+compatible : Adora Belle, Weatherwax, Binky, Ponder Stibbons, Detritus, Elenor Of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum, Kaos
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : typography, highlight, color, text tags       : typography, highlight, color, text
  
-downloadurl: https://github.com/hanche/dokuwiki_color_plugin/archive/2018-10-12.zip+downloadurl: https://github.com/hanche/dokuwiki_color_plugin/archive/refs/tags/2022-10-19.tar.gz
 sourcerepo : https://github.com/hanche/dokuwiki_color_plugin sourcerepo : https://github.com/hanche/dokuwiki_color_plugin
 bugtracker : https://github.com/hanche/dokuwiki_color_plugin/issues bugtracker : https://github.com/hanche/dokuwiki_color_plugin/issues
  
-screenshot_img: :plugin:color_plugin.png+screenshot_img: https://folk.ntnu.no/hanche/tmp/dokuwiki_color_plugin.png
 ---- ----
  
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>
  
-and you will see:+and you will see something like this:
  
-{{:plugin:color_plugin.png?nolink|Color plugin in action}}+{{https://folk.ntnu.no/hanche/tmp/dokuwiki_color_plugin.png|Color plugin in action}}
  
-… and two more samples – the new maintainer of the plugin does not have the authority to upload a new image, so the old one will have to do for the time being.+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.
  
-This plugin supports the [[wp>X11_color_names#Color_name_chart|X11 color names]], +If you use a color specification that contains a slash (''/''), you must use a colon ('':'') to separate the foreground and background color specs. 
-hex triples (like #123 or #123456 for rgb), + 
-hex quadruples (#1234 or #12345678 for rgba), +The precise syntax is as follows. Square brackets (''[]'') indicate optional parts, and should //not// be included literally: 
-[[https://developer.mozilla.org/en-US/docs/Web/CSS/color_value|rgb, rgba, hsl, and hsla]] +<code> 
-color specifications. +<color [⟨fg-color⟩][/⟨bg-color⟩]>⟨text⟩</color
-This plugin does not try hard to catch syntax errors in your color specifications, however. +<color [⟨fg-color⟩]:[⟨bg-color⟩]>⟨text⟩</color> 
-If you use these specifications wrong, you may simply notice that they won't work.+</code> 
 +You //must// use the second form if either color spec includes a slash. 
 +Note that in that case, the colon separater ('':''is mandatory. 
 + 
 +No valid color spec including a colon is known at this timebut 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: 
 + 
 +<code> 
 +<color hwb(120 20% 30% / 50%):>some faded dark green semi-transparent text</color> 
 +</code> 
 + 
 +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 specificationssee 
 +[[https://developer.mozilla.org/en-US/docs/Web/CSS/color_value|the color page]] at developer.mozilla.org.
 Beware that not all color specifications work on all browsers. Beware that not all color specifications work on all browsers.
-Check [[https://caniuse.com/|Can I Use]] if in doubt.+See the bottom of the referenced page for more information, or 
 +check [[https://caniuse.com/|Can I Use]] if in doubt
 + 
 +  * The plugin works by wrapping contents in a %%<span>%% element with a suitable %%style%% attribute. Therefore, you cannot wrap it around block level items such as headers, lists, and tables. 
 +  * 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
  
 ===== Discussion ===== ===== Discussion =====
Line 59: Line 82:
 ===== Development ===== ===== Development =====
  
-Christopher Smith seems leaved the plugin unmaintained. Another user leeyc0 provided hosting of the plugin in the github, but have no time to maintain it. Anyone interested in maintaining may leave a ticket in github and leeyc0 will be glad to hand over the project.+**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 =====
  
 +  * 2022-10-19 Allow the use of a colon separator, so that the color specs may contain a slash
 +  * 2022-10-16 Removed the (too stringent) syntax checking of the color specifications, in order to be able to handle CSS 4 colors and possible future color specs
 +  * 2022-09-15 Removed deprecated and unnecessary (but harmless) code
 +  * 2018-10-12 New maintainer
 +  * 2018-10-10 Added support for rgb[a](…) and hsl[a](…) color specifications
 +  * 2018-08-09 Added code for handling metadata to the render method
   * 2016-06-25 Added ODT support based on branch "redesign"   * 2016-06-25 Added ODT support based on branch "redesign"
   * 2014-01-04 hosted in github by leeyc0   * 2014-01-04 hosted in github by leeyc0
   * 2008-02-06 --- Fixed a security vulnerability in the colour pattern. Any users of this plugin should apply this update.  --- //[[chris@jalakai.co.uk|Christopher Smith]] 2008-02-06 17:20//    * 2008-02-06 --- Fixed a security vulnerability in the colour pattern. Any users of this plugin should apply this update.  --- //[[chris@jalakai.co.uk|Christopher Smith]] 2008-02-06 17:20// 
  
plugin/color.1539368199.txt.gz · Last modified: 2018-10-12 20:16 by hanche

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