Help:Coloring text: Difference between revisions

Eric Martz (talk | contribs)
Eric Martz (talk | contribs)
 
(33 intermediate revisions by 2 users not shown)
Line 2: Line 2:


==Where To Use Each Coloring Method==
==Where To Use Each Coloring Method==
===Page Text===


*'''Page Text''' can be colored by any of the four TEMPLATE or SPAN methods below (as demonstrated below for each). TEMPLATE methods are recommended.
'''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 Text''' for molecular scenes (green links) can be colored '''ONLY by SPAN CLASSES'''. Neither single color spans nor templates of either kind work in captions.
===Caption 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.
Important: For '''Boldface''' colored text in captions, use '''<b>bold</b>'''. Wiki markup, three single quotes, does not work in captions.
Line 28: 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 36: 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.


Available classes are
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.
 
<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 48: 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>,
<b><span class="text-chocolate">text-chocolate</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>.
 
Temporary test colors, proposed to be added classes:
<span style="background-color:#ffb0b0;padding-left:7px;padding-right:7px;">pink</span>,
<span style="color:#808000;font-weight:bold;">olive</span>,
<span style="background-color:#dfff00;padding-left:7px;padding-right:7px;">yellowgreen</span>,
<span style="background-color:#00ff00;padding-left:7px;padding-right:7px;">lightgreen</span>,
<span style="background-color:#90ffff;padding-left:7px;padding-right:7px;">lightcyan</span>,
<span style="color:#00a0a0;font-weight:bold;">cyan</span>,
<span style="background-color:#c0d0ff;padding-left:7px;padding-right:7px;">lightblue</span>,
<span style="color:#8000ff;font-weight:bold;">purple</span>,
<span style="background-color:#ffc0ff;padding-left:7px;padding-right:7px;">NEWviolet/lightmagenta</span>,
<span style="background-color:#e8e8e8;padding-left:7px;padding-right:7px;">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>.


Span style colors also work for light colors, using a colored background with black text: &lt;span style="background-color:yellow;padding-left:7px;padding-right:7px;">Yellow&lt;/span>. The "padding" makes the color extend slightly beyond the text, which looks better: <span style="background-color:yellow;padding-left:7px;padding-right:7px;">Yellow</span>.
Span style colors also work for light colors, using a colored background with black text: &lt;span style="background-color:yellow;padding-left:0.3em;padding-right:0.3em;">Yellow&lt;/span>. The "padding" makes the color extend slightly beyond the text, which looks better: <span style="background-color:yellow;padding-left:0.3em;padding-right:0.3em;">Yellow</span>. 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 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]: <span style="color:gray;">&lt;font color="red">'''Red'''&lt;/font></span>
'''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>.-->

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

Eric Martz, Jaime Prilusky