HOW TO

Add the $ARCHOME/symbols/colorfile as an ArcInfo shadeset and find equivalent color values for ArcView 3.x

Summary

Instructions provided describe the steps to convert the $ARCHOME/symbols/colorfile to an ArcInfo shadeset, and find the equivalent hue, saturation and values (HSV) for color mapping in ArcView 3.x. This allows cross-reference of color names and colors between applications.

Procedure



  1. Convert the colorfile to an ArcInfo shadeset.

    The Colorfile2shade.aml converts the Colorfile to an ArcInfo shadeset and creates a text file that lists the color names and CMYK (cyan, magenta, yellow and black) values.

    a) Open the following 'show me' link, select the AML code block and paste the code into Notepad.

    b) Save the file as colorfile2shade.aml and place the AML file in the workspace where your ArcInfo Workstation session starts, that is, C:\workspace or other.

    &severity &error &routine bail

    &args out_shadeset
    &if [null %out_shadeset%] &then
    &return Usage: &r colorfile2shade <out shadeset>

    &do file &list %out_shadeset% colorlist.txt
    &s d [delete %file% -file]
    &end

    &s f [open %ARCHOME%\symbols\colorfile ostat -read]
    &s list [open colorlist.txt ostat -write]

    display 9999
    ap

    shadedelete all
    shadetype color

    &s record [read %f% rstat]
    &s count = 0
    &do &while %rstat% = 0

    &s count = %count% + 1

    &s cyan [extract 1 [unquote %record%]]
    &s magenta [extract 2 [unquote %record%]]
    &s yellow [extract 3 [unquote %record%]]
    &s black [extract 4 [unquote %record%]]
    &s name [extract 5 [unquote %record%]]

    &s colorlist [show cmyk cmyk %cyan% %magenta% %yellow% %black%]
    shadecolor cmyk %colorlist%
    shadeput %count%

    &s line [format '%1,-3% %2,25% %3%' %count% [quote [unquote %name%]] [quote [unquote %colorlist%]]]
    &s w [write %list% %line%]

    &s record [read %f% rstat]

    &end /* do-while loop

    shadesave %out_shadeset%

    &s c [close -all]

    quit

    &return

    &routine bail

    &if [show program] = ARCPLOT &then
    quit

    &s c [close -all]
    &s d [delete colorlist.txt -file]
    &s d [delete %out_shadeset% -file]

    &return An error has occurred in COLORFILE2SHADE.AML



    The Arc Macro Language (AML) file, run at the Arc prompt, creates the shadeset in the workspace where the AML executes. Run the AML at the ARC prompt with the following syntax:

    Code:
    Arc: &r colorfile2shade.aml colorfile.shd

  2. Copy the newly created shadeset to the %ARCHOME%\symbols directory, where it can be accessed by ArcPlot and ArcEdit.
  3. Colorfile2hsv.aml converts the colorfile to HSV. The output from the AML is a textfile that lists the color names and HSV equivalents for ArcView 3.x.

    &severity &error &routine bail

    &args out_shadeset
    &if [null %out_shadeset%] &then
    &return Usage: &r colorfile2shade <out shadeset>

    &do file &list %out_shadeset% colorfile2hsv.txt
    &s d [delete %file% -file]
    &end

    &s f [open %ARCHOME%\symbols\colorfile ostat -read]
    &s list [open colorfile2hsv.txt ostat -write]

    display 9999
    ap

    shadedelete all
    shadetype color

    &s record [read %f% rstat]
    &s count = 0
    &do &while %rstat% = 0

    &s count = %count% + 1

    &s cyan [extract 1 [unquote %record%]]
    &s magenta [extract 2 [unquote %record%]]
    &s yellow [extract 3 [unquote %record%]]
    &s black [extract 4 [unquote %record%]]
    &s name [extract 5 [unquote %record%]]

    &s hsv_color [show hsv cmyk %cyan% %magenta% %yellow% %black%]
    shadecolor hsv %hsv_color%
    shadeput %count%

    &s line [format '%1,-3% %2,25% %3%' %count% [quote [unquote %name%]] [quote [unquote %hsv_color%]]]
    &s w [write %list% %line%]

    &s record [read %f% rstat]

    &end /* do-while loop

    shadesave %out_shadeset%

    &s c [close -all]

    quit

    &return

    &routine bail

    &if [show program] = ARCPLOT &then
    quit

    &s c [close -all]
    &s d [delete colorfile2hsv.txt -file]
    &s d [delete %out_shadeset% -file]

    &return An error has occurred in COLORFILE2HSV.AML

  4. The shadeset and textfile are created in the workspace where the command is executed. Run colorfile2hsv.aml at the ARC prompt with the following syntax:

    Code:
    Arc: &r colorfile2hsv.aml colorfile.avp

Article ID:000002445

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic