AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
getColorName (Color value) yoix.awt
 
Returns the canonical name of the supplied color value if it exists in the yoix.awt.Color dictionary. If multiple entries for the same color value are stored in yoix.awt.Color, just the one canoncal name for that color is returned. Refer to the documentation of addColor for a description of canonical color names as used in this context.
 
 Example:   The program,
import yoix.*.*;

Color salmon = {
    double red   = 1.0;
    double green = 0.73;
    double blue  = 0.73;
};

addColor("PERIWINKLE", 0.86, 0.86, 1.0);
addColor("salmon", salmon);
addColor("Limey_Lime", "#baffba");
addColor("grey25", "#404040");

stdout.nextline = getColorName(Color.PERIWINKLE);
stdout.nextline = getColorName(Color.salmon);
stdout.nextline = getColorName(Color.Limey_Lime);
stdout.nextline = getColorName(Color.grey25);
returns the canonical names for the requested colors, namely:
periwinkle
salmon
limeylime
darkgray
Note that last name, darkgray results from the color value, Color.grey25 having been stored in yoix.awt.Color as both Color.DARK_GRAY and Color.darkGray when the color dictionary was automatically initialized with the colors in Java's java.awt.Color package.
 
 Return:   int
 
 See Also:   addColor, Color, getBrighterColor, getCMYKColor, getDarkerColor, getHSBColor, getHSBComponents, getRGBColor

 

Yoix is a registered trademark of AT&T Inc.