Dies ist die alte 4D Dokumentations-Website. Die neue und aktualisierte Dokumentation finden Sie unter developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
SVG_Define_solidColor
|
SVG_Define_solidColor ( parentSVGObject ; id ; color {; opacity} ) -> Funktionsergebnis | ||||||||
Parameter | Typ | Beschreibung | ||||||
parentSVGObject | SVG_Ref |
![]() |
Reference of parent element | |||||
id | String |
![]() |
Color name | |||||
color | String |
![]() |
Color expression | |||||
opacity | Lange Ganzzahl |
![]() |
Opacity | |||||
Funktionsergebnis | SVG_Ref |
![]() |
Color reference | |||||
The SVG_Define_solidColor command sets a new custom color in the SVG container designated by parentSVGObject and returns its reference. If parentSVGObject is not an SVG document, an error is generated.
The id parameter specifies the color name. The name will be used to associate a color with an object. If an element with the same name exists, it will be replaced.
The color parameter is a color expression recognized by SVG (see Colors and Gradients).
The optional opacity parameter can be used to specify an opacity (from 0 to 100) for this color. If the parameter is omitted, the opacity will be 100%.
The color set in this way will be associated with the fill or stroke paint by passing the string "url(#ID)" as the value when a color expression is expected.
`Set blue to 50%
SVG_Define_solidColor($svg;"MyColor";"blue";50)
...
SVG_New_rect($svg;0;0;20;20;0;0;"url(#MyColor)";"url(#MyColor)")
...
$line:=SVG_New_line(10;10;100;100)
SVG_SET_STROKE_BRUSH($line;"url(#MyColor)")
Produkt: 4D
Thema: Structure and Definitions
Nummer:
65989
Erstellt: Composant 4D SVG v11.3
4D SVG ( 4D v20 R7)