Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Calculates color value for RGB.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 4.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
Red | The red color component from 0 to 255. | 0 |
Green | The green color component from 0 to 255. | 255 |
Blue | The blue color component from 0 to 255. | 255 |
Returns color value as number.
Get a blue color value:
MBS( "DynaPDF.RGB"; 0; 0; 255 )
Example result: 16711680
Get a red color value:
MBS( "DynaPDF.RGB"; 255 )
Example result: 255
Write text in RGB colors:
Set Variable [ $r ; Value: MBS("DynaPDF.SetColorSpace"; $pdf; "DeviceRGB") ]
# calculate color values for RBB
Set Variable [ $red ; Value: MBS( "DynaPDF.RGB"; 255; 0; 0 ) ]
Set Variable [ $green ; Value: MBS( "DynaPDF.RGB"; 0; 255; 0 ) ]
Set Variable [ $blue ; Value: MBS( "DynaPDF.RGB"; 0; 0; 255 ) ]
# now write some text
Set Variable [ $r ; Value: MBS("DynaPDF.SetTextRect"; $pdf; 100; 100; 500; 200) ]
Set Variable [ $r ; Value: MBS("DynaPDF.WriteFText"; $pdf; "left"; "Testing: " &
"\FC[" & $red & "]Red" &
"\FC[" & $green & "]Green" &
"\FC[" & $blue & "]Blue" ) ]
This function is free to use.
Created 18th August 2014, last changed 3th March 2022