new ColorScheme(config)
This class represents a color scheme or ramp that can be used for thematic
mapping of numeric or categorical data. A color scheme can be generated based
on a single hue (when only the baseColor is specified in the options parameter),
or span across multiple hues or colors (when both fromColor and toColor
are specified in the options parameter). If all three attributes: baseColor, fromColor and
toColor are specified, then only fromColor and toColor are used, resulting in
a multi-hue color scheme.
For single hue color schemes, the generated color stops become progressively
darker (with decreased brightness) starting with the base color.
For multi-hue color schemes, the generated color stops change their hue from
the fromColor to the toColor.
If you need greater control of how the color stops are generated, you may
programmatically create a set of OM.style.Color styles and pass them to a ColorScheme.
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | A configuration object for color scheme styles. It has the following
|
Returns:
An instance of OM.style.ColorScheme
- Type
- OM.style.ColorScheme
Example
new OM.style.ColorScheme ({ styleName: 'Tornados 2010', numClasses : 5, classification: 'equal', // 'custom', defaultStyle: style, baseColor: "#ff000000", fillOpacity: 0.5, stroke:"#000000", strokeOpacity:0.6, strokeThickness:1 })
Methods
-
getColorStops()
-
A convenient method to return the list of generated colors.
Returns:
An array of colors in hex-strings.
- Type
- Array