• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Color sample

  • Template
  • Talk
  • Language
  • Watch
  • View source
(Redirected from Template:Colorsample)

 

Template documentation[view] [edit] [history] [purge]

Usage

  • {{Color sample|red}} →  
  • {{Color sample|#00FF00}} →  
  • {{Color sample|#00FF00|description=green}} →  
    Adds a description of the color for screen reader users
  • {{Color sample|{{party color|Independent politician}}}} →  
    (Instead of specifying a color directly, this example uses {{party color|Independent politician}}, which generates #DCDCDC.)

Size option:

  • A second parameter allows to define the size of the square: 1 is large (default), 0.6 is quite small, 0.2 is minuscule. Examples:
{{Colorsample|#008000}} or {{Colorsample|#008000|1}} gives:  
{{Colorsample|#008000|0.5}} gives:  
{{Colorsample|#008000|0.2}} gives:  

Note: When hovered over, the template shows the value used for color as a tooltip by default. This is also heard by a screen reader. An optional parameter, |description= can be used to change that to something more user-friendly, as shown in the third example.

See also

  • Template:Swatch inline
  • Template:Swatch
  • Lists of colors
  • Web colors
The above documentation is transcluded from Template:Color sample/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Color_sample&oldid=1301823149"
Last edited on 21 July 2025, at 22:26

Languages

    • العربية
    • অসমীয়া
    • Asturianu
    • Авар
    • Azərbaycanca
    • বাংলা
    • Башҡортса
    • Беларуская
    • भोजपुरी
    • Bosanski
    • Català
    • Чӑвашла
    • Cymraeg
    • Dansk
    • ཇོང་ཁ
    • Ελληνικά
    • فارسی
    • Føroyskt
    • ГӀалгӀай
    • ગુજરાતી
    • 한국어
    • हिन्दी
    • Hrvatski
    • Ilokano
    • Bahasa Indonesia
    • עברית
    • ქართული
    • Lietuvių
    • Li Niha
    • La .lojban.
    • मैथिली
    • Македонски
    • മലയാളം
    • Bahasa Melayu
    • Мокшень
    • မြန်မာဘာသာ
    • नेपाली
    • नेपाल भाषा
    • 日本語
    • Norsk bokmål
    • ଓଡ଼ିଆ
    • ਪੰਜਾਬੀ
    • Português
    • Română
    • Русский
    • संस्कृतम्
    • Scots
    • සිංහල
    • Simple English
    • Slovenčina
    • Soomaaliga
    • کوردی
    • Српски / srpski
    • Srpskohrvatski / српскохрватски
    • Suomi
    • Svenska
    • Tagalog
    • တႆး
    • తెలుగు
    • ไทย
    • Тоҷикӣ
    • Українська
    • اردو
    • Tiếng Việt
    • 吴语
    • 粵語
    • 中文
    • ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 21 July 2025, at 22:26 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop