Colors API using schema
        This example is using marshmallow schemas
778979
def get(self, palette):
        
        all_colors = {
            'cmyk': ['cian', 'magenta', 'yellow', 'black'],
            'rgb': ['red', 'green', 'blue']
        }
        if palette == 'all':
            result = all_colors
        else:
            result = {palette: all_colors.get(palette)}
        return jsonify(result)
971237
def _build_schema(self, s):
        
        w = self._whatis(s)
        if w == self.IS_LIST:
            w0 = self._whatis(s[0])
            js = {"type": "array",
                  "items": {"type": self._jstype(w0, s[0])}}
        elif w == self.IS_DICT:
            js = {"type": "object",
                  "properties": {key: self._build_schema(val) for key, val in s.items()}}
            req = [key for key, val in s.items() if not val.is_optional]
            if req:
                js["required"] = req
        else:
            js = {"type": self._jstype(w, s)}
        for k, v in self._json_schema_keys.items():
            if k not in js:
                js[k] = v
        return js
1105732
function getColorVisual(seriesModel, visualMapModel, value, valueState) {
    var mappings = visualMapModel.targetVisuals[valueState];
    var visualTypes = VisualMapping.prepareVisualTypes(mappings);
    var resultVisual = {
        color: seriesModel.getData().getVisual('color') // default color.
    };

    for (var i = 0, len = visualTypes.length; i < len; i++) {
        var type = visualTypes[i];
        var mapping = mappings[
            type === 'opacity' ? '__alphaForOpacity' : type
        ];
        mapping && mapping.applyVisual(value, getVisual, setVisual);
    }

    return resultVisual.color;

    function getVisual(key) {
        return resultVisual[key];
    }

    function setVisual(key, value) {
        resultVisual[key] = value;
    }
}
1374420
def usage
      parameters = @link_schema.parameters.map { |parameter| "<#{parameter}>" }
      parameters = parameters.empty? ? '' : " #{parameters.join(' ')}"
      example_body = @link_schema.example_body
      body_parameter = example_body.nil? ? '' : ' <body>'
      @output.write <<-USAGE
Usage: #{@cli_name} #{name}#{parameters}#{body_parameter}

Description:
  #{description}
USAGE
      if example_body
        example_body = MultiJson.dump(example_body, pretty: true)
        example_body = example_body.lines.map do |line|
          "  #{line}"
        end.join
        @output.write <<-USAGE

Body example:
#{example_body}
USAGE
      end
    end
1244913
function parse_clrScheme(t, themes, opts) {
	themes.themeElements.clrScheme = [];
	var color = {};
	(t[0].match(tagregex)||[]).forEach(function(x) {
		var y = parsexmltag(x);
		switch(y[0]) {
			/* 20.1.6.2 clrScheme (Color Scheme) CT_ColorScheme */
			case '<a:clrScheme': case '</a:clrScheme>': break;

			/* 20.1.2.3.32 srgbClr CT_SRgbColor */
			case '<a:srgbClr':
				color.rgb = y.val; break;

			/* 20.1.2.3.33 sysClr CT_SystemColor */
			case '<a:sysClr':
				color.rgb = y.lastClr; break;

			/* 20.1.4.1.1 accent1 (Accent 1) */
			/* 20.1.4.1.2 accent2 (Accent 2) */
			/* 20.1.4.1.3 accent3 (Accent 3) */
			/* 20.1.4.1.4 accent4 (Accent 4) */
			/* 20.1.4.1.5 accent5 (Accent 5) */
			/* 20.1.4.1.6 accent6 (Accent 6) */
			/* 20.1.4.1.9 dk1 (Dark 1) */
			/* 20.1.4.1.10 dk2 (Dark 2) */
			/* 20.1.4.1.15 folHlink (Followed Hyperlink) */
			/* 20.1.4.1.19 hlink (Hyperlink) */
			/* 20.1.4.1.22 lt1 (Light 1) */
			/* 20.1.4.1.23 lt2 (Light 2) */
			case '<a:dk1>': case '</a:dk1>':
			case '<a:lt1>': case '</a:lt1>':
			case '<a:dk2>': case '</a:dk2>':
			case '<a:lt2>': case '</a:lt2>':
			case '<a:accent1>': case '</a:accent1>':
			case '<a:accent2>': case '</a:accent2>':
			case '<a:accent3>': case '</a:accent3>':
			case '<a:accent4>': case '</a:accent4>':
			case '<a:accent5>': case '</a:accent5>':
			case '<a:accent6>': case '</a:accent6>':
			case '<a:hlink>': case '</a:hlink>':
			case '<a:folHlink>': case '</a:folHlink>':
				if (y[0].charAt(1) === '/') {
					themes.themeElements.clrScheme.push(color);
					color = {};
				} else {
					color.name = y[0].substring(3, y[0].length - 1);
				}
				break;

			default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');
		}
	});
}
105992
def create_colormap(palette):
    """"""
    from trollimage.colormap import Colormap
    fname = palette.get('filename', None)
    if fname:
        data = np.load(fname)
        cmap = []
        num = 1.0 * data.shape[0]
        for i in range(int(num)):
            cmap.append((i / num, (data[i, 0] / 255., data[i, 1] / 255.,
                                   data[i, 2] / 255.)))
        return Colormap(*cmap)

    colors = palette.get('colors', None)
    if isinstance(colors, list):
        cmap = []
        values = palette.get('values', None)
        for idx, color in enumerate(colors):
            if values:
                value = values[idx]
            else:
                value = idx / float(len(colors) - 1)
            cmap.append((value, tuple(color)))
        return Colormap(*cmap)

    if isinstance(colors, str):
        from trollimage import colormap
        import copy
        return copy.copy(getattr(colormap, colors))

    return None
378852
def _dict2schema(dct):
    
    attrs = dct.copy()
    if MARSHMALLOW_VERSION_INFO[0] < 3:

        class Meta(object):
            strict = True

        attrs["Meta"] = Meta
    return type(str(""), (ma.Schema,), attrs)
591473
function palette({ baseColor: themeColor = baseColor, src = 'css/rsuite.min.css', dist } = {}, doneCallback) {

  try {
    if (!dist) {
      throw  `ERROR: [option.dist] is required`;
    }
  } catch (e) {
    console.log(e.red);
    return;
  }

  const originColors = color.calcColors(baseColor);
  const themeColors = color.calcColors(themeColor);
  const distPath = Path.dirname(dist);

  const ensureDir = path => new Promise((resolve) => {
    fse.ensureDir(path, () => resolve());
  });

  const readData = path => new Promise(resolve => {
    fs.readFile(path, 'utf-8', (err, data) => {
      resolve(data || '');
    });
  });

  const writeData = (path, data) => new Promise((resolve, reject) => {
    fs.writeFile(path, data, (err) => {
      if (err) {
        reject(err);
      }
      resolve();
    });
  });

  const handleCallback = (...args) => doneCallback && doneCallback(args);

  const generateThemes = async function () {
    try {
      await ensureDir(distPath);
      let data = await readData(Path.join(rootPath, src));
      originColors.forEach((color, index) => {
        data = data.replace(new RegExp(color, 'g'), themeColors[index]);
      });
      await  writeData(dist, data);
      console.log(`Palette ${dist}` + '[SUCCESS]'.green);
      handleCallback();
    } catch (e) {
      console.log(`Palette ${dist}` + '[FAILD]'.red);
      handleCallback(e);
    }
  };

  generateThemes();

  return module.exports;
}
1166961
def build_colormap(palette, info):
        """"""

        from trollimage.colormap import Colormap
        if 'palette_meanings' in palette.attrs:
            palette_indices = palette.attrs['palette_meanings']
        else:
            palette_indices = range(len(palette))

        sqpalette = np.asanyarray(palette).squeeze() / 255.0
        tups = [(val, tuple(tup))
                for (val, tup) in zip(palette_indices, sqpalette)]
        colormap = Colormap(*tups)
        if 'palette_meanings' not in palette.attrs:
            sf = info.get('scale_factor', np.array(1))
            colormap.set_range(
                *(np.array(info['valid_range']) * sf + info.get('add_offset', 0)))

        return colormap, sqpalette
274001
function addSchemaField(schema, pathName, fieldSpec) {
	const fieldSchema = {};
	fieldSchema[pathName] = fieldSpec;
	return schema.add(fieldSchema);
}
1135257
@SuppressWarnings({ "rawtypes", "unchecked" })
  public static Schema toPangoolSchema(org.apache.avro.Schema avroSchema) {
		List<Field> fields = new ArrayList<Field>();
		for(org.apache.avro.Schema.Field avroField : avroSchema.getFields()) {
			org.apache.avro.Schema.Type type = avroField.schema().getType();
			Field pangoolField;
			switch(type){
			case INT: pangoolField = Field.create(avroField.name(),Type.INT); break;
			case LONG: pangoolField = Field.create(avroField.name(),Type.LONG); break;
			case FLOAT: pangoolField = Field.create(avroField.name(),Type.FLOAT); break;
			case DOUBLE: pangoolField = Field.create(avroField.name(),Type.DOUBLE); break;
			case BOOLEAN: pangoolField = Field.create(avroField.name(),Type.BOOLEAN); break;
			case STRING: pangoolField = Field.create(avroField.name(),Type.STRING); break;
			case BYTES:
				if (avroField.getProp(Field.METADATA_BYTES_AS_OBJECT) == null){
					pangoolField = Field.create(avroField.name(),Type.BYTES);
				} else {
					try {
					String objectClazz = avroField.getProp(Field.METADATA_OBJECT_CLASS);
					pangoolField = Field.createObject(avroField.name(),Class.forName(objectClazz));
					String serializationString = avroField.getProp(Field.METADATA_OBJECT_SERIALIZATION);
					if (serializationString != null){
							Class<? extends Serialization> ser=
		             (serializationString == null) ? null : 
			          	(Class<? extends Serialization>)Class.forName(serializationString);
							pangoolField.setObjectSerialization(ser);
					}
					
					} catch(ClassNotFoundException e) {
	          throw new PangoolRuntimeException(e);
          }
				}
				break;
			case ENUM:
				String objectClazz = avroField.getProp(Field.METADATA_OBJECT_CLASS);
				try{
					pangoolField = Field.createEnum(avroField.name(),Class.forName(objectClazz));
					} catch(ClassNotFoundException e){
						throw new PangoolRuntimeException(e);
					}
				break;
			default:
				throw new PangoolRuntimeException("Avro type:" + type + " can't be converted to Pangool Schema type");
			}
			//add properties 
			for(Map.Entry<String,String> entry : avroField.props().entrySet()){
				if (!Field.RESERVED_KEYWORDS.contains(entry.getKey())){
					pangoolField.addProp(entry.getKey(),entry.getValue());
				}
			}
			fields.add(pangoolField);
			
		}
		Schema schema = new Schema(avroSchema.getFullName(), fields);
		return schema;
	}
307443
function SchemaString (key, options) {
  this.enumValues = [];
  this.regExp = null;
  SchemaType.call(this, key, options, 'String');
}
114181
function hexToRgba (color) {
    var hex   = color[ 0 ] === '#' ? color.substr(1) : color,
      dig   = hex.length / 3,
      red   = hex.substr(0, dig),
      green = hex.substr(dig, dig),
      blue  = hex.substr(dig * 2);
    if (dig === 1) {
      red += red;
      green += green;
      blue += blue;
    }
    return 'rgba(' + parseInt(red, 16) + ',' + parseInt(green, 16) + ',' + parseInt(blue, 16) + ',0.1)';
  }
691614
def color_for (arg)
      arg = Yummi::Context::new(arg) unless arg.is_a? Context
      call(arg)
    end
987552
def swagger_schema(self, request):
        """"""
        if self.parent is None:
            return {}

        spec = APISpec(
            self.parent.name, self.parent.cfg.get('VERSION', ''),
            plugins=['apispec.ext.marshmallow'], basePatch=self.prefix
        )

        for paths, handler in self.handlers.items():
            spec.add_tag({
                'name': handler.name,
                'description': utils.dedent(handler.__doc__ or ''),
            })
            for path in paths:
                operations = {}
                for http_method in handler.methods:
                    method = getattr(handler, http_method.lower())
                    operation = OrderedDict({
                        'tags': [handler.name],
                        'summary': method.__doc__,
                        'produces': ['application/json'],
                        'responses': {200: {'schema': {'$ref': {'#/definitions/' + handler.name}}}}
                    })
                    operation.update(utils.load_yaml_from_docstring(method.__doc__) or {})
                    operations[http_method.lower()] = operation

                spec.add_path(self.prefix + path, operations=operations)

            if getattr(handler, 'Schema', None):
                kwargs = {}
                if getattr(handler.meta, 'model', None):
                    kwargs['description'] = utils.dedent(handler.meta.model.__doc__ or '')
                spec.definition(handler.name, schema=handler.Schema, **kwargs)

        return deepcopy(spec.to_dict())
541395
private void loadStandardHtmlColors() {

		if (standardHtmlColorNames==null) {
			standardHtmlColorNames = new Hashtable<String,Color>();
			addStandardHtmlColor( "AliceBlue" 	, new Color(0xF0F8FF));
			addStandardHtmlColor( "AntiqueWhite" 	, new Color(0xFAEBD7));
			addStandardHtmlColor( "Aqua" 	, new Color(0x00FFFF));
			addStandardHtmlColor( "Aquamarine" 	, new Color(0x7FFFD4));
			addStandardHtmlColor( "Azure" 	, new Color(0xF0FFFF));
			addStandardHtmlColor( "Beige" 	, new Color(0xF5F5DC));
			addStandardHtmlColor( "Bisque" 	, new Color(0xFFE4C4));
			addStandardHtmlColor( "Black" 	, new Color(0x000000));
			addStandardHtmlColor( "BlanchedAlmond" 	, new Color(0xFFEBCD));
			addStandardHtmlColor( "Blue" 	, new Color(0x0000FF));
			addStandardHtmlColor( "BlueViolet" 	, new Color(0x8A2BE2));
			addStandardHtmlColor( "Brown" 	, new Color(0xA52A2A));
			addStandardHtmlColor( "BurlyWood" 	, new Color(0xDEB887));
			addStandardHtmlColor( "CadetBlue" 	, new Color(0x5F9EA0));
			addStandardHtmlColor( "Chartreuse" 	, new Color(0x7FFF00));
			addStandardHtmlColor( "Chocolate" 	, new Color(0xD2691E));
			addStandardHtmlColor( "Coral" 	, new Color(0xFF7F50));
			addStandardHtmlColor( "CornflowerBlue" 	, new Color(0x6495ED));
			addStandardHtmlColor( "Cornsilk" 	, new Color(0xFFF8DC));
			addStandardHtmlColor( "Crimson" 	, new Color(0xDC143C));
			addStandardHtmlColor( "Cyan" 	, new Color(0x00FFFF));
			addStandardHtmlColor( "DarkBlue" 	, new Color(0x00008B));
			addStandardHtmlColor( "DarkCyan" 	, new Color(0x008B8B));
			addStandardHtmlColor( "DarkGoldenRod" 	, new Color(0xB8860B));
			addStandardHtmlColor( "DarkGray" 	, new Color(0xA9A9A9));
			addStandardHtmlColor( "DarkGreen" 	, new Color(0x006400));
			addStandardHtmlColor( "DarkKhaki" 	, new Color(0xBDB76B));
			addStandardHtmlColor( "DarkMagenta" 	, new Color(0x8B008B));
			addStandardHtmlColor( "DarkOliveGreen" 	, new Color(0x556B2F));
			addStandardHtmlColor( "DarkOrange" 	, new Color(0xFF8C00));
			addStandardHtmlColor( "DarkOrchid" 	, new Color(0x9932CC));
			addStandardHtmlColor( "DarkRed" 	, new Color(0x8B0000));
			addStandardHtmlColor( "DarkSalmon" 	, new Color(0xE9967A));
			addStandardHtmlColor( "DarkSeaGreen" 	, new Color(0x8FBC8F));
			addStandardHtmlColor( "DarkSlateBlue" 	, new Color(0x483D8B));
			addStandardHtmlColor( "DarkSlateGray" 	, new Color(0x2F4F4F));
			addStandardHtmlColor( "DarkTurquoise" 	, new Color(0x00CED1));
			addStandardHtmlColor( "DarkViolet" 	, new Color(0x9400D3));
			addStandardHtmlColor( "DeepPink" 	, new Color(0xFF1493));
			addStandardHtmlColor( "DeepSkyBlue" 	, new Color(0x00BFFF));
			addStandardHtmlColor( "DimGray" 	, new Color(0x696969));
			addStandardHtmlColor( "DodgerBlue" 	, new Color(0x1E90FF));
			addStandardHtmlColor( "FireBrick" 	, new Color(0xB22222));
			addStandardHtmlColor( "FloralWhite" 	, new Color(0xFFFAF0));
			addStandardHtmlColor( "ForestGreen" 	, new Color(0x228B22));
			addStandardHtmlColor( "Fuchsia" 	, new Color(0xFF00FF));
			addStandardHtmlColor( "Gainsboro" 	, new Color(0xDCDCDC));
			addStandardHtmlColor( "GhostWhite" 	, new Color(0xF8F8FF));
			addStandardHtmlColor( "Gold" 	, new Color(0xFFD700));
			addStandardHtmlColor( "GoldenRod" 	, new Color(0xDAA520));
			addStandardHtmlColor( "Gray" 	, new Color(0x808080));
			addStandardHtmlColor( "Green" 	, new Color(0x008000));
			addStandardHtmlColor( "GreenYellow" 	, new Color(0xADFF2F));
			addStandardHtmlColor( "HoneyDew" 	, new Color(0xF0FFF0));
			addStandardHtmlColor( "HotPink" 	, new Color(0xFF69B4));
			addStandardHtmlColor( "IndianRed " 	, new Color(0xCD5C5C));
			addStandardHtmlColor( "Indigo " 	, new Color(0x4B0082));
			addStandardHtmlColor( "Ivory" 	, new Color(0xFFFFF0));
			addStandardHtmlColor( "Khaki" 	, new Color(0xF0E68C));
			addStandardHtmlColor( "Lavender" 	, new Color(0xE6E6FA));
			addStandardHtmlColor( "LavenderBlush" 	, new Color(0xFFF0F5));
			addStandardHtmlColor( "LawnGreen" 	, new Color(0x7CFC00));
			addStandardHtmlColor( "LemonChiffon" 	, new Color(0xFFFACD));
			addStandardHtmlColor( "LightBlue" 	, new Color(0xADD8E6));
			addStandardHtmlColor( "LightCoral" 	, new Color(0xF08080));
			addStandardHtmlColor( "LightCyan" 	, new Color(0xE0FFFF));
			addStandardHtmlColor( "LightGoldenRodYellow" 	, new Color(0xFAFAD2));
			addStandardHtmlColor( "LightGray" 	, new Color(0xD3D3D3));
			addStandardHtmlColor( "LightGreen" 	, new Color(0x90EE90));
			addStandardHtmlColor( "LightPink" 	, new Color(0xFFB6C1));
			addStandardHtmlColor( "LightSalmon" 	, new Color(0xFFA07A));
			addStandardHtmlColor( "LightSeaGreen" 	, new Color(0x20B2AA));
			addStandardHtmlColor( "LightSkyBlue" 	, new Color(0x87CEFA));
			addStandardHtmlColor( "LightSlateGray" 	, new Color(0x778899));
			addStandardHtmlColor( "LightSteelBlue" 	, new Color(0xB0C4DE));
			addStandardHtmlColor( "LightYellow" 	, new Color(0xFFFFE0));
			addStandardHtmlColor( "Lime" 	, new Color(0x00FF00));
			addStandardHtmlColor( "LimeGreen" 	, new Color(0x32CD32));
			addStandardHtmlColor( "Linen" 	, new Color(0xFAF0E6));
			addStandardHtmlColor( "Magenta" 	, new Color(0xFF00FF));
			addStandardHtmlColor( "Maroon" 	, new Color(0x800000));
			addStandardHtmlColor( "MediumAquaMarine" 	, new Color(0x66CDAA));
			addStandardHtmlColor( "MediumBlue" 	, new Color(0x0000CD));
			addStandardHtmlColor( "MediumOrchid" 	, new Color(0xBA55D3));
			addStandardHtmlColor( "MediumPurple" 	, new Color(0x9370DB));
			addStandardHtmlColor( "MediumSeaGreen" 	, new Color(0x3CB371));
			addStandardHtmlColor( "MediumSlateBlue" 	, new Color(0x7B68EE));
			addStandardHtmlColor( "MediumSpringGreen" 	, new Color(0x00FA9A));
			addStandardHtmlColor( "MediumTurquoise" 	, new Color(0x48D1CC));
			addStandardHtmlColor( "MediumVioletRed" 	, new Color(0xC71585));
			addStandardHtmlColor( "MidnightBlue" 	, new Color(0x191970));
			addStandardHtmlColor( "MintCream" 	, new Color(0xF5FFFA));
			addStandardHtmlColor( "MistyRose" 	, new Color(0xFFE4E1));
			addStandardHtmlColor( "Moccasin" 	, new Color(0xFFE4B5));
			addStandardHtmlColor( "NavajoWhite" 	, new Color(0xFFDEAD));
			addStandardHtmlColor( "Navy" 	, new Color(0x000080));
			addStandardHtmlColor( "OldLace" 	, new Color(0xFDF5E6));
			addStandardHtmlColor( "Olive" 	, new Color(0x808000));
			addStandardHtmlColor( "OliveDrab" 	, new Color(0x6B8E23));
			addStandardHtmlColor( "Orange" 	, new Color(0xFFA500));
			addStandardHtmlColor( "OrangeRed" 	, new Color(0xFF4500));
			addStandardHtmlColor( "Orchid" 	, new Color(0xDA70D6));
			addStandardHtmlColor( "PaleGoldenRod" 	, new Color(0xEEE8AA));
			addStandardHtmlColor( "PaleGreen" 	, new Color(0x98FB98));
			addStandardHtmlColor( "PaleTurquoise" 	, new Color(0xAFEEEE));
			addStandardHtmlColor( "PaleVioletRed" 	, new Color(0xDB7093));
			addStandardHtmlColor( "PapayaWhip" 	, new Color(0xFFEFD5));
			addStandardHtmlColor( "PeachPuff" 	, new Color(0xFFDAB9));
			addStandardHtmlColor( "Peru" 	, new Color(0xCD853F));
			addStandardHtmlColor( "Pink" 	, new Color(0xFFC0CB));
			addStandardHtmlColor( "Plum" 	, new Color(0xDDA0DD));
			addStandardHtmlColor( "PowderBlue" 	, new Color(0xB0E0E6));
			addStandardHtmlColor( "Purple" 	, new Color(0x800080));
			addStandardHtmlColor( "RebeccaPurple" 	, new Color(0x663399));
			addStandardHtmlColor( "Red" 	, new Color(0xFF0000));
			addStandardHtmlColor( "RosyBrown" 	, new Color(0xBC8F8F));
			addStandardHtmlColor( "RoyalBlue" 	, new Color(0x4169E1));
			addStandardHtmlColor( "SaddleBrown" 	, new Color(0x8B4513));
			addStandardHtmlColor( "Salmon" 	, new Color(0xFA8072));
			addStandardHtmlColor( "SandyBrown" 	, new Color(0xF4A460));
			addStandardHtmlColor( "SeaGreen" 	, new Color(0x2E8B57));
			addStandardHtmlColor( "SeaShell" 	, new Color(0xFFF5EE));
			addStandardHtmlColor( "Sienna" 	, new Color(0xA0522D));
			addStandardHtmlColor( "Silver" 	, new Color(0xC0C0C0));
			addStandardHtmlColor( "SkyBlue" 	, new Color(0x87CEEB));
			addStandardHtmlColor( "SlateBlue" 	, new Color(0x6A5ACD));
			addStandardHtmlColor( "SlateGray" 	, new Color(0x708090));
			addStandardHtmlColor( "Snow" 	, new Color(0xFFFAFA));
			addStandardHtmlColor( "SpringGreen" 	, new Color(0x00FF7F));
			addStandardHtmlColor( "SteelBlue" 	, new Color(0x4682B4));
			addStandardHtmlColor( "Tan" 	, new Color(0xD2B48C));
			addStandardHtmlColor( "Teal" 	, new Color(0x008080));
			addStandardHtmlColor( "Thistle" 	, new Color(0xD8BFD8));
			addStandardHtmlColor( "Tomato" 	, new Color(0xFF6347));
			addStandardHtmlColor( "Turquoise" 	, new Color(0x40E0D0));
			addStandardHtmlColor( "Violet" 	, new Color(0xEE82EE));
			addStandardHtmlColor( "Wheat" 	, new Color(0xF5DEB3));
			addStandardHtmlColor( "White" 	, new Color(0xFFFFFF));
			addStandardHtmlColor( "WhiteSmoke" 	, new Color(0xF5F5F5));
			addStandardHtmlColor( "Yellow" 	, new Color(0xFFFF00));
			addStandardHtmlColor( "YellowGreen" 	, new Color(0x9ACD32));
			log.debug("Standard HTML color names loaded.");
		}
	}
1304848
function getNodeColor(node, seriesModel, ecModel) {
    // Color from visualMap
    var visualColor = node.getVisual('color');
    var visualMetaList = node.getVisual('visualMeta');
    if (!visualMetaList || visualMetaList.length === 0) {
        // Use first-generation color if has no visualMap
        visualColor = null;
    }

    // Self color or level color
    var color = node.getModel('itemStyle').get('color');
    if (color) {
        return color;
    }
    else if (visualColor) {
        // Color mapping
        return visualColor;
    }
    else if (node.depth === 0) {
        // Virtual root node
        return ecModel.option.color[0];
    }
    else {
        // First-generation color
        var length = ecModel.option.color.length;
        color = ecModel.option.color[getRootId(node) % length];
    }
    return color;
}