Command to create new named color styles and add to existing color dataset.




brewcolors – is a program used to create new named color styles and/or add colors to the color dataset. The program includes sub-commands to create these colors manually or to add colors from the XKCD color survey.

Syntax

brewcolors xkcd new [, make install colors(string) replace override ]

Description

brewcolors builds a local database of named RGB colors on the user’s system. It also includes transformed RGB values for different forms of color sight impairments.

Options

make is an optional argument used to append the resulting color dataset to the master colordata set used by brewscheme.

install is an optional argument used to create each of the named color style files and place them on the ADOPATH to be accessible in Stata.

colors is an optional argument used to pass the color name and RGB values when using the new subcommand.

replace is an optional argument used to overwrite an existing version of the color dataset being created.

override is an optional argument used to suppress the warning message printed to the console by brewcolordb.

Examples

Ex 1.

Creates the dataset with all of the XKCD colors and installs them as named color styles for Stata to use.

brewcolors xkcd, mk inst over rep

You should then be able to access the named color styles from XKCD in the graph menus:

brewcolorsEx1

And will also have access to versions of the colors that simulate their appearance under different forms of color sight impairments:

brewcolorsEx2

Once you’ve done this you should be all set. If the look up database is not present when brewscheme is called it will build the file automatically for you, but before you can create a scheme/theme file you’ll need to have the data set and modified named color styles created by brewcolordb.

Ex 2.

Add a new color style to the color database and make it available in Stata using the default name constructor

brewcolors new, ma inst colors("117 200 47")

The result of the command above is the file color-udc117_200_47.style stored in `“`c(sysdir_personal)’/style/”’. The file contents are:

*! v 0.0.0 21 Mar 2016 05:35:24
*! Color defined by the user: billy
sequence udc117_200_4711
label "User Defined Color - udc117_200_47"

set rgb "117 200 47"

Ex 3.

Add a new named color style to the color database using a user specified name

brewcolors new, ma inst colors(`""mycolor 117 200 47""')

The result of the last command is the creation of the file color-mycolor.style which will be saved in `“`c(sysdir_personal)’/style/”’. The contents of the file are:

*! v 0.0.0 21 Mar 2016 04:57:25
*! Color defined by the user: billy
sequence mycolor11
label "User Defined Color - mycolor"

set rgb "117 200 47"