SolidColor#
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)#
- 参数:
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 属性#
SVG Attributes
solid-color –
'currentColor | <color> | inherit'
(__init__() 参数 color)
solid-color 属性指定应为此 solidColor 元素使用的颜色。关键字 "currentColor"
可以像在 <paint> 规格中的 fill 和 stroke 属性中一样指定。
solid-opacity –
'<opacity-value> | inherit'
(__init__() 参数 opacity)
solid-opacity 参数定义了 solidColor 的不透明度。任何超出 0.0 (完全透明)到 1.0 (完全不透明)范围的值必须被限制在此范围内。
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.