hmCal_SET APP GRADIENT(area;reference;ArrayOffset;ArrayRed;ArrayGreen;ArrayBlue;ArrayAlpha)

Parameter          Type             Description
area               Longint      ->  hmCal area
reference          Longint      ->  appointment reference
ArrayOffset        Real-Array   ->  Array with offsets
ArrayRed           Longint-Array->  Array with red color component
ArrayGreen         Longint-Array->  Array with green color component
ArrayBlue          Longint-Array->  Array with blue color component
ArrayAlpha         Real-Array   ->  Array with alpha channel


The command hmCal_SET APP GRADIENT sets a custom gradient for an appointment. You have to pass 5 arrays with the same size into this command. The array ArrayOffset represents the positions of each color from 0 to 1. 0 represents the left position of the appointment, 1 is the right position. In the arrays ArrayRed, ArrayGreen and ArrayBlue you have to pass the color as 16 bit components. The array ArrayAlpha is the alpha channel of the color from 0 (=transparent) to 1 (=opaque).

The gradient is always from the left to the right border of the appointment.

To activate the gradient, the property hmCal_aprop_UseGradient must be set with the command hmCal_Set App Property. Also the effect hmCal_aprop_Effect must be set to hmCal_Effect_Fading.


The following example sets the gradient with 3 colors (red, green, blue) for an appointment with the ID=1:


$vl_error:=hmCal_Set App Property ($vl_area;1;hmCal_aprop_UseGradient;1;"";!00.00.00!)
$vl_error:=hmCal_Set App Property ($vl_area;1;hmCal_aprop_Effect;2;"";!00.00.00!)

ARRAY REAL($tz_offsets;3)
ARRAY LONGINT($tl_red;3)
ARRAY LONGINT($tl_green;3)
ARRAY LONGINT($tl_blue;3)
ARRAY REAL($tz_alpha;3)




hmCal_SET APP GRADIENT ($vl_area;1;$tz_offsets;$tl_red;$tl_green;$tl_blue;$tz_alpha)

Result is: