SolidColor

The solidColor element is a paint server that provides a single color with opacity. It can be referenced like the other paint servers (i.e. gradients).

class svgwrite.solidcolor.SolidColor(color='currentColor', opacity=None, **extra)

The solidColor element is a paint server that provides a single color with opacity. It can be referenced like the other paint servers (i.e. gradients). The color parameter specifies the color that shall be used for this solidColor element. The keyword "currentColor" can be specified in the same manner as within a <paint> specification for the fill and stroke properties. The opacity parameter defines the opacity of the solidColor.

Methods

SolidColor.__init__(color='currentColor', opacity=None, **extra)
Parameters:
  • color – solid color like the other paint servers (i.e. gradients).
  • opacity (float) – opacity of the solid color in the range 0.0 (fully transparent) to 1.0 (fully opaque)

SVG Attributes

  • solid-color'currentColor | <color> | inherit' (__init__() parameter color)

    The solid-color attribute specifies the color that shall be used for this solidColor element. The keyword "currentColor" can be specified in the same manner as within a <paint> specification for the fill and stroke properties.

  • solid-opacity'<opacity-value> | inherit' (__init__() parameter opacity)

    The solid-opacity parameter defines the opacity of the solidColor. Any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) must be clamped to this range.