{smcl}
{* *! version 1.1 30Aug2018}{...}
{* *! Help file by Mead Over for style files by by Mallika Snyder, Center for Global Development August, 2018}{...}
{vieweralsosee "[G-4] colorstyle" "help colorstyle"}{...}
{vieweralsosee "" "--"}{...}
{vieweralsosee "[G-4] colorstyle" "mansection G-4 colorstyle"}{...}
{vieweralsosee "" "--"}{...}
{vieweralsosee "[G-2] palette" "help palette"}{...}
{vieweralsosee "[G-4] schemes intro" "help schemes"}{...}
{viewerjumpto "Description" "cgd_colors##description"}{...}
{viewerjumpto "Remarks" "cgd_colors##remarks"}{...}
{viewerjumpto "Author" "cgd_colors##authors"}{...}
{title:Title}
{pstd}
CGD_Colors: A package to install CGD colors for use in Stata graphs.
{marker description}{...}
{title:Description}
{pstd}
This package installs CGD colors for subsequent use in Stata graphs and schemes.
{manhelp colorstyle G-4:colorstyle}.
{marker remmarks}{...}
{title:Remarks}
{pstd}
As documented in {help colorstyle}, Stata users who want to customize
the colors used in their graphs, but prefer to avoid the tedium of looking up
and specifying RGB codes, have the option of specifying pre-defined,
named colors. The user can list the pre-defined colors available on
his or her installation of Stata by typing: {stata graph query colorstyle}
from inside Stata.
{pstd}
In 2018, as part of its periodic revision of its web site and its publication
styles, the {browse "http://www.cgdev.org/":Center for Global Development}
specified a color palette as the default palette for CGD web content and
publications. This Stata package adds these colors to those available by
name to the Stata user.
{pstd}
The CGD colors added to Stata with this package are:
{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:Primary}
{synopt:{opt cgdteal}}Teal{p_end}
{synopt:{opt cgddkgray}}Dark gray{p_end}
{synopt:{opt cgdwmgray}}Warm gray{p_end}
{syntab:Secondary}
{synopt:{opt cgdred}}Red{p_end}
{synopt:{opt cgdorange}}Orange{p_end}
{synopt:{opt cgdyellow}}Yellow{p_end}
{synopt:{opt cgdgreen}}Green{p_end}
{synopt:{opt cgdblue}}Blue{p_end}
{synopt:{opt cgdpurple}}Purple{p_end}
{synopt:{opt cgdbeige}}Beige{p_end}
{synopt:{opt cgdbluegray}}Blue gray{p_end}
{synopt:{opt cgdltgray}}Light gray{p_end}
{pstd}
To learn more about any specific color, use Stata's {help palette color} commmand.
For example, by typing {stata palette color teal} at the Stata prompt, you will see
that Stata's version of that color is defined by the RGB codes "110 142 132".
{pstd}
Once you have installed this package, you can use this commmand to compare any
two colors, such as Stata's teal color and CGD's version of teal, by typing:
{stata palette color teal cgdteal}. You will see that CGD's teal is defined
by the RGD code "0 103 127".
{marker examples}
{title:Examples}
* Clear your current data from memory and load Stata's demo data
{stata sysuse auto, clear:sysuse auto, clear}
* First construct a bar graph using the colors in your current default Stata graphics {help scheme}
{stata graph bar length displacement turn mpg gear_ratio trunk:graph bar length displacement turn mpg gear_ratio trunk}
* Now construct a bar graph using CGD Teal as the color of the first bar
{stata graph bar length displacement turn mpg gear_ratio trunk, bar(1, fcolor(cgdteal) lcolor(cgdteal)) }
* Or use CGD Teal as the color of the fourth bar
{stata graph bar length displacement turn mpg gear_ratio trunk, bar(4, fcolor(cgdteal) lcolor(cgdteal)) }
* The following syntax will assign the first six of CGD's colors to the six bars
* But this code must be executed from DO file.
graph bar length displacement turn mpg gear_ratio trunk, ///
bar(1, fcolor(cgdteal) lcolor(cgdteal)) ///
bar(2, fcolor(cgddkgray) lcolor(cgddkgray)) ///
bar(3, fcolor(cgdwmgray) lcolor(cgdwmgray)) ///
bar(4, fcolor(cgdred) lcolor(cgdred)) ///
bar(5, fcolor(cgdorange) lcolor(cgdorange)) ///
bar(6, fcolor(cgdyellow) lcolor(cgdyellow))
* Bundled with this package is a DO file called {stata do cgd_colors_examples.do:cgd_colors_examples.do}
* To execute all of the above commmands, including the bar graph using a CGD
* color for all 6 of the bars, run this DO file from your Stata commmand line.
{marker authors}{...}
{title:Author}
{pstd}
Mallika Snyder coded the "style" files which define CGD's colors based on their RGB definitions.
{phang}Contact
{browse "https://www.cgdev.org/staff/mallika-snyder":Mallika Snyder} at:
{browse "mailto:msnyder@cgdev.org":MSnyder@CGDev.Org} or
{browse "http://www.cgdev.org/expert/mead-over/":Mead Over} at:
{browse "mailto:mover@cgdev.org":MOver@CGDev.Org} with questions, problems or suggestions.{p_end}
{* version 1.1 30Aug2018 Correct typos}{...}