Help:Coloring text: Difference between revisions

From Proteopedia
Jump to navigation Jump to search
Eric Martz (talk | contribs)
Eric Martz (talk | contribs)
Line 93: Line 93:


==HTML Font Colors==
==HTML Font Colors==
'''NOT Recommended''' (here for historical reference). Coloring using HTML font tags is [https://www.w3schools.com/tags/tag_font.asp '''NOT recommended''' as it is technically not supported by HTML5]: <font color="red">'''Red'''</font>
'''NOT Recommended''' (here for historical reference). Coloring using HTML font tags is [https://www.w3schools.com/tags/tag_font.asp '''NOT recommended''' as it is technically not supported by HTML5]: <span style="color:gray;">&lt;font color="red">'''Red'''&lt;/font></span>
<!-- which looks like this: <font color="red">'''Red'''</font>. In addition to color names, you can use Red-Green-Blue [https://www.rapidtables.com/web/color/RGB_Color.html (RGB) hexadecimal codes] following "#", for example &lt;font color="#8000ff">'''Purple'''&lt;/font> which looks like this: <font color="#8000ff">'''Purple'''</font>.-->
<!-- which looks like this: <font color="red">'''Red'''</font>. In addition to color names, you can use Red-Green-Blue [https://www.rapidtables.com/web/color/RGB_Color.html (RGB) hexadecimal codes] following "#", for example &lt;font color="#8000ff">'''Purple'''&lt;/font> which looks like this: <font color="#8000ff">'''Purple'''</font>.-->

Revision as of 01:37, 26 December 2020

There are several ways you can color text in Proteopedia pages. Not all methods work in all contexts.

Where To Use Each Coloring MethodWhere To Use Each Coloring Method

  • Page Text can be colored by any of the first four methods below (as demonstrated below for each).
  • Captions for molecular scenes (green links):
    • PDB file based scenes can be colored with
      • Span classes
    • PNGJ file based scened can be colored with
      • Span classes
      • NOT Wikitext templates: NOT {{Font color|red|red text}} and NOT standard color scheme templates.

Important: to Boldface colored text in captions, use <b>bold</b>. Wiki markup, three single quotes, does not work in captions.

Color Scheme TemplatesColor Scheme Templates

Standard chemical element or macromolecular color schemes can be inserted with templates. This is much simpler than constructing each one by hand as needed. See Help:Color Keys. But this method does not work in captions for molecular scenes (green links).

Examples: C H O N P S Se Fe

 Amino Terminus                 Carboxy Terminus 

Methods for these and other color schemes will be found at Help:Color Keys.

Font Color TemplatesFont Color Templates

This method is recommended for darker colors. (For light colors, color the background of black text as shown with other methods below.) To get green text or another more exotic text color, use the Template:Font_color, entering the color and the desired text, as follows:

{{Font color|green|green text}} or another {{Font color|#a569bd|more exotic}}

Colored text is more visible when bold. Surround the above codes with three single quotes, as follows:

'''{{Font color|#00A0A0|Cyan}}'''

which displays as Cyan.

Class Color SpansClass Color Spans

Class colors work for both dark and light colors. Use <span class="bg-warning text-white"> like this </span> that looks like this. This method works in all contexts but is limited to the pre-set color below.

Available classes are primary , secondary , success , info , warning , danger , light , dark and white . You will use each class combined with text- to color a text, or bg- for the background.

Another set of class colors available in Proteopedia: text-red, text-orange / bg-orange, text-brown, text-chocolate, bg-yellow, bg-yellowgreen, text-green, text-cyan, text-blue, text-magenta, text-violet / bg-violet, text-gray, bg-black text-white.

Temporary test colors, proposed to be added classes: pink, olive, yellowgreen, lightgreen, lightcyan, cyan, lightblue, purple, NEWviolet/lightmagenta, lightgray.

Style Color SpansStyle Color Spans

You can color using CSS spans: <span style="color:red;font-weight:bold;">Red</span>, which looks like this: Red. In addition to color names, you can use Red-Green-Blue (RGB) hexadecimal codes following "#", for example <span style="color:#8000ff;font-weight:bold;">Purple</span> which looks like this: Purple.

Span style colors also work for light colors, using a colored background with black text: <span style="background-color:yellow;padding-left:7px;padding-right:7px;">Yellow</span>. The "padding" makes the color extend slightly beyond the text, which looks better: Yellow.

HTML Font ColorsHTML Font Colors

NOT Recommended (here for historical reference). Coloring using HTML font tags is NOT recommended as it is technically not supported by HTML5: <font color="red">Red</font>

Proteopedia Page Contributors and Editors (what is this?)Proteopedia Page Contributors and Editors (what is this?)

Eric Martz, Jaime Prilusky