Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ColorOper - method of object Pm

Description:
Execution of the color conversion.
Syntax:
ColorOper(vInput As Variant, nType As Long, [vPar As Variant]) As Variant
Calling:
color = Pm.ColorOper(vInput, nType)
Parameters:
vInput(Variant) Input value over which the conversion of the nType type will be executed.
nType(Long) Conversion type of the vInput input value:
2 - Darken or lighten the color.

vInput is RGB String written as #RRGGBB. Returns a RGB String written as #RRGGBB. The returned color is lighter or darker than the color defined in vInput. The vPar parameter is a real number ranging from -1 to 1, that defines the lighten ratio (from 0 to 1), or darken ratio (from 0 to -1).

11 - Red color compound.

vInput is RGB String written as #RRGGBB. The numeric value (0-255) of the red component (RR) is returned. The vPar parameter is irrelevant here.

12 - Green color compound.

vInput is RGB String written as #RRGGBB. The numeric value (0-255) of the green component (GG) is returned. The vPar parameter is irrelevant here.

13 - Blue color compound.

vInput is RGB String written as #RRGGBB. The numeric value (0-255) of the blue component (BB) is returned. The vPar parameter is irrelevant here.

21 - COlor defined by index.

vInput is the color entered by the numeric index to the PROMOTIC color palette. Returns a RGB String written as #RRGGBB. The vPar parameter is irrelevant here.

vPar[optional] (Variant) Transfomation type parameter. The meaning of this parameter is based on the nType parameter.
Note:
The method can also be called in the graphic item events for Web Panels. The nType=21 is not functional in the WEB panel.

The method is functional also in Macro expression $.expr.

Example1:
The example converts RGB String to three numbers: In nR (red) the value will be 255 (=ff hexa), In nG (green) the value will be 1, In nB (blue) the value will be (=d7 hexa).
nR = Pm.ColorOper("#ff01d7", 11)
nG = Pm.ColorOper("#ff01d7", 12)
nB = Pm.ColorOper("#ff01d7", 13)
Example2:
This example transforms the grey color ("#808080") to lighter grey with the lighten ratio of 0.6.
Dim sColor1, sColor2
sColor1 = "#808080"
sColor2 = Pm.ColorOper(sColor1, 2, 0.6)
Navigation:
 
- Pm
 
- Abs
- ColorOper
 
 
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice