skyline college finals schedule spring 2016
Wednesday, March 27, 2019

skyline college finals schedule spring 2016


colored text in latex

Start LaTeX faq LaTeX topics LaTeX course

< colored frames   > set margins in latex  

colored text in latex

How to write colored text in latex? To get color into LaTeX use the usepackage xcolor. By using the command \textcolorcolortext
Per default the following colors are available:
red, green, blue, cyan, magenta, yellow, black, white , darkgray, gray, lightgray

example colored text in latex

\documentclassarticle
\usepackagexcolor
\begindocument
\textcolorredred, \textcolorgreengreen, \textcolorblueblue,
\textcolorcyancyan, \textcolormagentamagenta,
\textcoloryellowyellow, \textcolorblackblack,
\fcolorboxblackwhite\textcolorblackwhite,
\textcolordarkgraydarkgray, \textcolorgraygray,
\textcolorlightgraylightgray
\enddocument

By using xcolor you also could get some colored frames.

colored text in latex beamer

How to change the text color in latex beamer? Or how to get colored text in latex beamer? In the following example first of all the background color of the frames would be changed to see the white text color.
Background color will be changed by the command \setbeamercolorbackground canvasbg=black!50
change the color of the writing by \setbeamercolornormal textfg=white and an addtional command \usebeamercolor*normal text. Without the last command text color would not change.
Now got a grey background and white text on it:
example code

\documentclassbeamer
\begindocument
\setbeamercolorbackground canvasbg=black!50
\setbeamercolornormal textfg=white\usebeamercolor*normal text
\beginframe
TEST
\endframe
% set it back to default values
\setbeamercolorbackground canvasbg=white,fg=black
\setbeamercolornormal textfg=black\usebeamercolor*normal text
\beginframe
TEST 2
\endframe
\enddocument

Other colors could be used in the same way.

Contact

Color

From ConTeXt wiki
Jump to: navigation , search

v · d · e

Color

General overview
  • Color
  • Color in MetaPost
Commands
General
  • \color
  • \MPcolor
  • \definecolor
  • \setupcolors
  • \showcolor
  • \usecolor
Logical palettes
  • \definepalet
  • \setuppalet
  • \showpalet
  • \comparepalet
Groups of similar colors
  • \definecolorgroup
  • \showcolorgroup
Manuals
  • ConTeXt reference manual
  • MetaFun manual
Source files
MkII (inc. color definitions)
  • colo-ini.mkii
  • colo-ema.mkii
  • colo-x11.mkii
  • colo-xwi.mkii
  • colo-ext.mkii
  • colo-hex.mkii
  • colo-rgb.mkii
MkIV
  • colo-ini.mkiv
  • colo-ini.lua
  • attr-col.lua
  • colo-ext.mkiv
  • colo-grp.mkiv
  • colo-run.mkiv
MkIV color definitions
  • colo-imp-dem.mkiv
  • colo-imp-rgb.mkiv
  • colo-imp-xwi.mkiv
  • colo-imp-ema.mkiv
  • colo-imp-x11.mkiv

ConTeXt supports two color models: RGB (typically used for screen display) and CMYK (typically used for printing). There is also support for spot colors (typically used for offset printing) and transparencies.

Contents

  • 1 Before you start …
  • 2 Basic Usage
  • 3 Pre-defined colors
    • 3.1 Default pre-defined colors
    • 3.2 X11 Colors
    • 3.3 Additional pre-defined colors
  • 4 Defining New Colors
    • 4.1 Cloning existing colors
    • 4.2 Adapting existing colors
  • 5 Advanced Usage
    • 5.1 Changing color of entire document
    • 5.2 Changing background color of page
    • 5.3 Using colors in MetaPost
    • 5.4 Using colors in TikZ
  • 6 Viewing pre-defined color
    • 6.1 View all defined colors
    • 6.2 View specific defined colors
  • 7 Testing if color is defined
  • 8 Specialized topics
  • 9 References

Before you start …

1. It is usually a bad style to use explicit color switches in the text. It is better to define a semantic command that takes care of the color switching. For example, instead of using \color[red]important text, define

\definehighlight[important][color=red]

and then use \importantimportant text in the text.

2. Colors are not enabled by default in MkII. To enabled colors in MkII, use

\setupcolors[state=start]

3. To disable colors in a document, use

\setupcolors[state=stop]

Basic Usage

To color text, use

\color[defined-color] ... text ... 

or

\startcolor[defined-color] ... text ... \stopcolor

where defined-color is a color defined using \definecolor . For example, red is one of the predefined colors. So, we can use:

Three \color[red]cool cats

or

\starttext\startcolor[red]\input tufte\stopcolor\stoptext

It is also possible to use RGB or CMYK or hex values to color text. The syntax for these is

\colored[settings]... text ...

where settings are the same settings as used by \definecolor . For example:

Three \colored[r=0.1, g=0.8, b=0.8]colorful cats

Note. There is no need to use the color commands directly. Almost all ConTeXt commands accept a color key, and you can use color=defined-color. For example,

  • To color the section titles red, use
\setuphead[color=red]
  • To color the footnotes red, use
\setupfootnotes[color=red]

etc.

Pre-defined colors

Default pre-defined colors

The following colors are pre-defined in ConTeXt (see colo-imp-rgb.mkiv ).

NameColorNameColorNameColorNameColor
black white 
gray lightgray middlegray darkgray 
red lightred middlered darkred 
green lightgreen middlegreen darkgreen 
blue lightblue middleblue darkblue 
cyan   middlecyan darkcyan 
magenta   middlemagenta darkmagenta 
yellow   middleyellow darkyellow 

X11 Colors

In addition to the above basic color, ConTeXt also includes a definition of the X11 colors . To load this list ( colo-imp-xwi.mkiv ), use

\usecolors[xwi]

This loads the following additional colors:

NameColorNameColorNameColorNameColor
aliceblue antiquewhite aquamarine azure 
beige bisque black blanchedalmond 
blue blueviolet brown burlywood 
cadetblue chartreuse chocolate coral 
cornflowerblue cornsilk cyan darkgoldenrod 
darkgreen darkkhaki darkolivegreen darkorange 
darkorchid darksalmon darkseagreen darkslateblue 
darkturquoise darkviolet deeppink deepskyblue 
dodgerblue firebrick floralwhite forestgreen 
gainsboro ghostwhite gold goldenrod 
green greenyellow honeydew hotpink 
indianred ivory khaki lavender 
lavenderblush lawngreen lemonchiffon lightblue 
lightcoral lightcyan lightgoldenrod lightgoldenrodyellow 
lightpink lightsalmon lightseagreen lightskyblue 
lightslateblue lightsteelblue lightyellow limegreen 
linen magenta maroon mediumaquamarine 
mediumblue mediumorchid mediumpurple mediumseagreen 
mediumslateblue mediumspringgreen mediumturquoise mediumvioletred 
midnightblue mintcream mistyrose moccasin 
navajowhite navy navyblue oldlace 
olivedrab orange orangered orchid 
palegoldenrod palegreen paleturquoise palevioletred 
papayawhip peachpuff peru pink 
plum powderblue purple red 
rosybrown royalblue saddlebrown salmon 
sandybrown seagreen seashell sienna 
skyblue slateblue snow springgreen 
steelblue tan thistle tomato 
turquoise violet violetred wheat 
white whitesmoke yellow yellowgreen 

Additional pre-defined colors

In addition to the above, there are two other sets of pre-defined colors.

x11\usecolors[x11] colo-imp-x11.mkiv658 extended Xorg color keywords (WWW), defined in hex RGB
crayola\usecolors[crayola] colo-imp-crayola.mkiv}235 Crayola (Binney & Smith) colors
ema\usecolors[ema] colo-imp-ema.mkiv 549 Emacs colors
RAL\usecolors[ral] colo-imp-ral.mkiv 213 RAL color system (Deutsches Institut für Gütesicherung und Kennzeichnung)
Solarized\usecolors[solarized] colo-imp-solarized.mkiv 16 solarized colors

Defining New Colors

New colors may be defined in the following ways

NameSytanx (and Example)Explanation
RGB color model
\definecolor[...][r=..., g=..., b=...]

For example,

\definecolor[lime][r=0.75, g=1, b=0]
This is \color[lime]a new colorthat we defined
The values for r, g, and b are floating point number between 0 and 1.
CMYK color model
\definecolor[...][c=.., m=.., y=.., k=..]

For example,

\definecolor[lime][c=0.25, m=0, y=1, k=0]
This is \color[lime]a new colorthat we defined
The values for c, m, y and k are floating point number between 0 and 1.
HSV color model
\definecolor[...][h=.., s=.., v=..]

For example,

\definecolor[lime][h=75, s=1, v=1]
This is \color[lime]a new colorthat we defined
The value for h is between 0 and 360; the values for s, v are floating point numbers between 0 and 1.
Hex
\definecolor[...][h=...]

For example,

\definecolor[lime][h=BFFF00]
This is \color[lime]a new colorthat we defined
The value for x is a three-byte hexadecimal number where the bytes represent the red, green, and blue values. This follows the HTML and CSS style of defining colors.
Gray scale
\definecolor[...][s=...]

For example,

\definecolor[screen][g=0.5]
This is \color[screen]a new colorthat we defined
The value for s is a floating point number between 0 and 1, representing the grayness value (1 represents white, 0 represents black).

Note: The key-values are overloaded. For example, h is used for both HSV model and Hex model; s is used for both HSV model and grayscale model. The distinction is made based on the presence or absence of the v key.

Cloning existing colors

You can clone an existing color using

\definecolor[new-color][old-color]

For example

\usecolors[xwi]\definecolor[highlight][yellow]\defineframed [important] [location=low, frame=off, background=color, backgroundcolor=highlight]This is a \importantimportantword.\definecolor[highlight][lavenderblush]This is a \importantimportantword.

Adapting existing colors

TODO: add details about this (See: To-Do List )

Advanced Usage

Changing color of entire document

To change the main text color of the document use

\setupcolors[textcolor=defined-color]

For example,

\setupcolors[textcolor=blue]\starttexttext\stoptext

Changing background color of page

The background color of the page can be changed using

\setupbackgrounds[page][background=color,backgroundcolor=defined-color]

For example,

\setuppapersize[A10]\setupbackgrounds[page][background=color,backgroundcolor=blue]\starttexttext\stoptext

Using colors in MetaPost

A color defined in TeX is available in MetaPost using \MPcolor.... For example:

\definecolor[highlight][r=0.8,g=0.8,b=0]\starttext\color[highlight]Highlighted text in TeX\startMPcodelabel("Highlighted text in MetaPost", origin) withcolor \MPcolorhighlight;\stopMPcode

Note that \MPcolor... behaves similar to a color primitive in MetaPost. For example, the following is valid MetaPost code.

color myColor; myColor = 0.5[\MPcolorhighlight, white];

Using colors in TikZ

Viewing pre-defined color

View all defined colors

To view pre-defined colors, you can use \showcolor . For example, to see all the colors defined in colo-imp-x11.mkiv , use (output truncated for display here …)

\showcolor[x11]

If you use \showcolor without any argument, all currently defined colors are shown.

View specific defined colors

To view the components of a defined color, you can use:

  • \showcolorcomponents
\showcolorcomponents[color-1, color-2]

For example,

\showcolorcomponents[red,middlered,darkred]
  • \colorcomponents
  • \transparencycomponents
  • \processcolorcomponents
\colorcompoentsdefined-color\tranparencycomponentsdefined-color\processcolorcomponentsdefined-color

For example,

\startlines\colorcomponentsred\transparencycomponentsred\processcolorcomponentsred\stoplines

Testing if color is defined

To test if a color is defined, use

  • \doifcolor
  • \doifcolorelse

Usage:

\doifcolorcolor-name... if branch ... \doifcolorelsecolor-name... if branch ...... else branch ...

Specialized topics

  • Color Palettes
  • Transparency
  • Spot Colors

References

  • Paletton – Website to choose color palettes
  • ColorBrewer – website to choose colors for maps and graphics.
  • Tina Sutton, Bride M Whelan: The Complete Color Harmony. Rockport Publishers (2004). ISBN 978-1592530311 (recommanded in the mailing list)

v · d · e

Getting Started

Installation
  • Installation
  • ConTeXt Standalone
Sample Documents
  • 1st document
  • Detailed Example
Books
  • Layouts in ConTeXt
  • Fonts in ConTeXt
  • Metafun Manual
  • MkII, MkIV, the history of LuaTeX
Resources
  • Mailing lists (Archives: mailman
  • gmane )
  • IRC
  • ConTeXt User Group
Beginner’s Manuals
  • ConTeXt, an excursion
  • User Manual ( print )
Doc structure
  • Project structure ( manual )
Visuals
Style
  • Font Switching
  • Indentation
  • Color
  • Quotes
  • Typographic style
  • It’s in the details
Fonts
  • Fonts in MkIV
  • Typography
  • Fonts out of ConTeXt
  • Symbols
Page Layout
  • Page Design
  • Page layout
  • Paper Setup
  • Imposition
  • Headers and Footers
Manipulation
  • Framing text
  • Crop text
  • Scale, Mirror, and Rotate text
Interaction
  • References ( manual )
  • PDF Bookmarks
  • PDF/X
XML
  • XML in MkIV
  • TEI XML
  • XHTML in MkIV
  • XML in MkII
Graphics
  • Using Graphics
  • Figure (XML) database ( print )
  • Flow charts
  • Step charts ( print )
  • MetaPost in ConTeXt
  • MetaFun ( print )
Mathematics
Display math
  • Display math
  • Math alignment
  • Math arrows
MathML
  • MathML Primer
  • MathML ( print )
  • OpenMath examples
  • MathML examples
Physics
  • Units
  • PhyML ( print )
Chemistry
  • ChemML ( print )
Tables
Overview
  • Tables Overview
Recommended
  • Tabulate
  • Natural Tables
  • Extreme tables
Experimental
  • Linetable
Manipulation
  • m-database
  • Simple Spreadsheets
Deprecated
  • Table
  • Tables (multipage Tables)
Typesetting verbatim
  • Annotated verbatim
  • t-vim
Bibliography
  • Bibliography in MkIV
  • Bibliography in MkII
Presentations
  • ConTeXt presentations
Correspondence
  • Correspondence module
Programming
  • Modes ( manual )
  • ConTeXt Lua Documents
  • LMX Templates

Retrieved from ” https://wiki.contextgarden.net/index.php?title=Color&oldid=23865 “
Categories :

  • Pages using duplicate arguments in template calls
  • ToDo

Navigation menu

Views

  • Page
  • Discussion
  • View source
  • History

Personal tools

  • Create account
  • Log in

Help

  • Categories
  • command reference

External Help

  • mail archive
  • source browser
  • ConTeXt online

Installation

  • download ConTeXt
  • download area
  • third party modules

Navigation

  • Main Page
  • Recent changes
  • Random page
  • Help

Tools

  • What links here
  • Related changes
  • Special pages
  • Printable version
  • Permanent link
  • Page information
GNU Free Documentation License 1.2
Powered by MediaWiki
  • This page was last edited on 18 September 2018, at 05:00.
  • Content is available under GNU Free Documentation License 1.2 unless otherwise noted.
  • Privacy policy
  • About ConTeXt wiki
  • Disclaimers