This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
SVG_Color_from_index
|
SVG_Color_from_index ( index ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
index | Longint |
![]() |
Number of color | |||||
Function result | Text field |
![]() |
Color designated by index | |||||
The SVG_Color_from_index returns the SVG color matching the 4D color specified in the index parameter.
The index parameter designates a number in the 4D color palette, where colors are numbered from 1 to 256. For more information about this point, refer to the description of the 4D _o_OBJECT SET COLOR command.
In this example, we recreate the 4D color palette:
$Dom_svg:=SVG_New
$Lon_line:=0
For($Lon_ii;0;15;1)
$Lon_column:=0
For($Lon_i;1;16;1)
$Txt_color:=SVG_Color_from_index(($Lon_ii*16)+$Lon_i)
$Dom_rect:=SVG_New_rect($Dom_svg;$Lon_column;
$Lon_line;11;11;0;0;"white";$Txt_color)
$Lon_column:=$Lon_column+11
End for
$Lon_line:=$Lon_line+11
End for
SVGTool_SHOW_IN_VIEWER($Dom_svg)
Product: 4D
Theme: Colors and Gradients
Number:
65873
Created: 4D v13
4D SVG Component ( 4D v20 R7)