Help:Coloring text: Difference between revisions

From Proteopedia
Jump to navigation Jump to search
Jaime Prilusky (talk | contribs)
No edit summary
Eric Martz (talk | contribs)
 
(26 intermediate revisions by 2 users not shown)
Line 31: Line 31:


==Single Font Color Templates==
==Single Font 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 {{Font color|green|green text}} or another {{Font color|#a569bd|more exotic}} text color, use the Template:Font_color, entering the color and the desired text, as follows:
This method is recommended for darker colors. (For light colors, color the background of black text as shown with other methods below.) This method '''does not work''' in captions for molecular scenes (green links).
 
To get {{Font color|green|green text}} or another {{Font color|#a569bd|more exotic}} text color, use the Template:Font_color, entering the color and the desired text, as follows:


<pre>{{Font color|green|green text}} or another {{Font color|#a569bd|more exotic}}</pre>
<pre>{{Font color|green|green text}} or another {{Font color|#a569bd|more exotic}}</pre>
Line 39: Line 41:
<pre>'''{{Font color|#00A0A0|Cyan}}'''</pre>
<pre>'''{{Font color|#00A0A0|Cyan}}'''</pre>
which displays as '''{{Font color|#00A0A0|Cyan}}'''.
which displays as '''{{Font color|#00A0A0|Cyan}}'''.
===Highlighting===
A special template highlights text in yellow.
<pre>{{Yelspan|highlighted}}</pre>
displays as {{Yelspan|highlighted}}.


==Class Color Spans==
==Class Color Spans==
Class colors work for both dark and light colors. Use &lt;span class="bg-warning text-white"> like this &lt;/span> that looks <span class="bg-warning text-white"> like this</span>. This method works in all contexts but is limited to the pre-set color below.
Class colors work for both dark and light colors. Use '''&lt;b>&lt;span class="text-purple">like this&lt;/span>&lt;/b>''' that displays <b><span class="text-purple">like this</span></b>, or '''&lt;span class="bg-yellowgreen">like this&lt;/span>''' that displays <span class="bg-yellowgreen">like this</span>. This method works in all contexts but is limited to the pre-set colors below.
 
Here is the main set of class colors available in Proteopedia. You will use each class combined with '''text-''' to color text, or '''bg-''' to color the background.


Available classes are
<table><tr><td>
Alphabetical order
* <span class="bg-black"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; black
* <span class="bg-blue"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; blue
* <span class="bg-brown"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; brown
* <span class="bg-cyan"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; cyan
* <span class="bg-gray"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; gray
* <span class="bg-green"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; green
* <span class="bg-lightblue"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; lightblue
* <span class="bg-lightcyan"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; lightcyan
* <span class="bg-lightgray"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; lightgray
* <span class="bg-lightgreen"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; lightgreen
* <span class="bg-lightmagenta"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; lightmagenta
* <span class="bg-magenta"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; magenta
* <span class="bg-olive"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; olive
* <span class="bg-orange"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; orange
* <span class="bg-pink"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; pink
* <span class="bg-purple"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; purple
* <span class="bg-red"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; red
* <span class="bg-violet"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; violet
* <span class="bg-yellow"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; yellow
* <span class="bg-yellowgreen"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; yellowgreen
* <span class="bg-white"> &nbsp; &nbsp; &nbsp; &nbsp; </span> &nbsp; white
</td><td>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</td><td style="border-left:1px solid gray;">
&nbsp;Spectral order
* <span class="bg-pink">bg-pink</span>
* <span class="text-red">'''text-red'''</span>
* <span class="text-brown">'''text-brown'''</span>
* <span class="text-orange">'''text-orange'''</span> <span class="bg-orange">bg-orange</span>
* <span class="bg-yellow">bg-yellow</span>
* <span class="bg-yellowgreen">bg-yellowgreen</span>
* <span class="text-olive">'''text-olive'''</span>
* <span class="bg-lightgreen">bg-lightgreen</span>
* <span class="text-green">'''text-green</span>
* <span class="bg-lightcyan">bg-lightcyan</span>
* <span class="text-cyan">'''text-cyan'''</span>
* <span class="bg-lightblue">bg-lightblue</span>
* <span class="text-blue">'''text-blue'''</span>
* <span class="text-purple">'''text-purple'''</span>
* <span class="bg-lightmagenta">bg-lightmagenta</span>
* <span class="text-magenta">'''text-magenta'''</span>
* <span class="bg-violet">bg-violet</span>
* <span class="bg-white">bg-white</span>
* <span class="bg-lightgray">bg-lightgray</span>
* <span class="text-gray">'''text-gray'''</span>
* <span class="text-black">text-black</span> <span class="bg-black text-white">bg-black text-white</span>
 
</td></tr></table>
 
Another set of classes is
<span class="bg-primary text-white"> primary </span>,
<span class="bg-primary text-white"> primary </span>,
<span class="bg-secondary text-white"> secondary </span>,
<span class="bg-secondary text-white"> secondary </span>,
Line 51: Line 111:
<span class="bg-danger text-white"> danger </span>,
<span class="bg-danger text-white"> danger </span>,
<span class="bg-light text-dark"> light </span>,
<span class="bg-light text-dark"> light </span>,
<span class="bg-dark text-white"> dark </span>
<span class="bg-dark text-white"> dark </span>  
and
and
<span class="bg-white text-dark"> white </span>.
<span class="bg-white text-dark">white</span>.
You will use each class combined with <b>text-</b> to color a text, or <b>bg-</b> for the background.


Another set of class colors available in Proteopedia:
==Style Color Spans==
<b>
This method works for page text, but '''does not work''' in captions for molecular scenes (green links).
<span class="text-red">text-red</span>,
<span class="text-orange">text-orange </span></b> /
<span class="bg-orange" style="padding-left:7px;padding-right:7px;">bg-orange</span>,
<b><span class="text-brown">text-brown</span></b>,
<span class="bg-yellow" style="padding-left:7px;padding-right:7px;">bg-yellow</span>,
<span class="bg-yellowgreen" style="padding-left:7px;padding-right:7px;">bg-yellowgreen</span>,
<b><span class="text-green">text-green</span></b>,
<b><span class="text-cyan">text-cyan</span></b>,
<b><span class="text-blue">text-blue</span></b>,
<b><span class="text-magenta">text-magenta</span></b>,
<b><span class="text-violet">text-violet</span></b> /
<span class="bg-violet" style="padding-left:7px;padding-right:7px;">bg-violet</span>,
<b><span class="text-gray">text-gray</span></b>,
<span class="bg-black text-white" style="padding-left:7px;padding-right:7px;">bg-black text-white</span>,
<span class="bg-pink">bg-pink</span>,
<b><span class="text-olive">text-olive</span></b>,
<span class="bg-yellowgreen">bg-yellowgreen</span>,
<span class="bg-lightgreen">bg-lightgreen</span>,
<span class="bg-lightcyan">bg-lightcyan</span>,
<b><span class="text-cyan">text-cyan</span></b>,
<span class="bg-lightblue">bg-lightblue</span>,
<b><span class="text-purple">text-purple</span></b>,
<span class="bg-lightmagenta">bg-lightmagenta</span>,
<b><span class="text-lightgray">text-lightgray</span></b>/<span class="bg-lightgray">bg-lightgray</span>.


==Style Color Spans==
You can color using CSS spans: &lt;span style="color:red;font-weight:bold;">Red&lt;/span>, which looks like this: <span style="color:red;font-weight:bold;">Red</span>. 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;span style="color:#8000ff;font-weight:bold;">Purple&lt;/span> which looks like this: <span style="color:#8000ff;font-weight:bold;">'''Purple'''</span>.
You can color using CSS spans: &lt;span style="color:red;font-weight:bold;">Red&lt;/span>, which looks like this: <span style="color:red;font-weight:bold;">Red</span>. 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;span style="color:#8000ff;font-weight:bold;">Purple&lt;/span> which looks like this: <span style="color:#8000ff;font-weight:bold;">'''Purple'''</span>.



Latest revision as of 22:33, 21 December 2024

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 TextPage Text

Page Text can be colored by any of the four TEMPLATE or SPAN methods below (as demonstrated below for each). TEMPLATE methods are generally recommended. However, for light colors that show better as background for text than the text itself, SPAN methods are better.

Caption TextCaption Text

Caption Text for molecular scenes (green links) can be colored ONLY by CLASS COLOR SPANS. Neither style color spans nor templates of either kind work in captions.

Important: For 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.

Single Font Color TemplatesSingle Font Color Templates

This method is recommended for darker colors. (For light colors, color the background of black text as shown with other methods below.) This method does not work in captions for molecular scenes (green links).

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.

HighlightingHighlighting

A special template highlights text in yellow.

{{Yelspan|highlighted}}

displays as highlighted.

Class Color SpansClass Color Spans

Class colors work for both dark and light colors. Use <b><span class="text-purple">like this</span></b> that displays like this, or <span class="bg-yellowgreen">like this</span> that displays like this. This method works in all contexts but is limited to the pre-set colors below.

Here is the main set of class colors available in Proteopedia. You will use each class combined with text- to color text, or bg- to color the background.

Alphabetical order

  •           black
  •           blue
  •           brown
  •           cyan
  •           gray
  •           green
  •           lightblue
  •           lightcyan
  •           lightgray
  •           lightgreen
  •           lightmagenta
  •           magenta
  •           olive
  •           orange
  •           pink
  •           purple
  •           red
  •           violet
  •           yellow
  •           yellowgreen
  •           white

         

 Spectral order

  • bg-pink
  • text-red
  • text-brown
  • text-orange bg-orange
  • bg-yellow
  • bg-yellowgreen
  • text-olive
  • bg-lightgreen
  • text-green
  • bg-lightcyan
  • text-cyan
  • bg-lightblue
  • text-blue
  • text-purple
  • bg-lightmagenta
  • text-magenta
  • bg-violet
  • bg-white
  • bg-lightgray
  • text-gray
  • text-black bg-black text-white

Another set of classes is primary , secondary , success , info , warning , danger , light , dark and white.

Style Color SpansStyle Color Spans

This method works for page text, but does not work in captions for molecular scenes (green links).

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:0.3em;padding-right:0.3em;">Yellow</span>. The "padding" makes the color extend slightly beyond the text, which looks better: Yellow. Padding given in 'em' units is relative to the font-size of the element; 0.3em means to leave a padding equal to 0.3 times the size of the current font.

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