KDE 4.7 PyKDE API Reference

- KDE's Python API

# GeoDataColorStyle Class Reference

`from PyKDE4.marble import *`

Inherits: Marble.GeoDataObject → Marble.GeoNode
Namespace: Marble

## Detailed Description

an abstract base class for various style classes

A GeoDataColorStyle is an abstract class that is the base class for a number of different style classes. It provides settings for specifying the color and color mode of the extended style classes. A GeoDataColorStyle should never be instantiated directly.

The color contains RGBA, (Red, Green, Blue, Alpha). Color and opacity (alpha) values have a range of 0 to 255 (00 to ff). For alpha, 00 is fully transparent and ff is fully opaque. For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: 7fff0000, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00.

The color mode can either be normal (no effect) or random. A value of random applies a random linear scale to the base color as follows.

To achieve a truly random selection of colors, specify a base color of white (ffffffff). If you specify a single color component (for example, a value of ff0000ff for red), random color values for that one component (red) will be selected. In this case, the values would range from 00 (black) to ff (full red). If you specify values for two or for all three color components, a random linear scale is applied to each color component, with results ranging from black to the maximum values specified for each component. The opacity of a color comes from the alpha component of color and is never randomized.

See also:
  GeoDataIconStyle

See also:
  GeoDataLabelStyle

See also:
  GeoDataLineStyle

## Enumerations
ColorMode | { Normal, Random }
## Methods
| __init__ (self)
| __init__ (self, Marble.GeoDataColorStyle other)
QColor | color (self)
Marble.GeoDataColorStyle.ColorMode | colorMode (self)
QString | nodeType (self)
| pack (self, QDataStream stream)
| setColor (self, QColor value)
| setColorMode (self, Marble.GeoDataColorStyle.ColorMode colorMode)
| unpack (self, QDataStream stream)

## Method Documentation

__init__ | ( |  | self ) |

__init__ | ( | self, |
|  | Marble.GeoDataColorStyle | other
| ) |  |  |

QColor color | ( |  | self ) |

Marble.GeoDataColorStyle.ColorMode colorMode | ( |  | self ) |

QString nodeType | ( |  | self ) |

pack | ( | self, |
|  | QDataStream | stream
| ) |  |  |

Serialize the style to a stream

Parameters:

  |  | stream the stream

setColor | ( | self, |
|  | QColor | value
| ) |  |  |

Set a new color

Parameters:

  |  | value the new color value

setColorMode | ( | self, |
|  | Marble.GeoDataColorStyle.ColorMode | colorMode
| ) |  |  |

Set a new color mode

Parameters:

  |  | colorMode the new color mode value

unpack | ( | self, |
|  | QDataStream | stream
| ) |  |  |

Unserialize the style from a stream

Parameters:

  |  | stream the stream

## Enumeration Documentation

ColorMode

Enumerator:

  Normal |
  Random |