Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.RGB

Calculates color value for RGB.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 4.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.RGB"; Red; Green; Blue )   More

Parameters

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

Result

Returns color value as number.

Description

Calculates color value for RGB.
For use with functions which take a color as a big number.
Calculation is Blue * 65536 + Green * 256 + Red.
Use it only if the color space is RGB.

Examples

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" ) ]

See also

Example Databases

Blog Entries

This function is free to use.

Created 18th August 2014, last changed 3th March 2022


DynaPDF.Print.SetSetting - DynaPDF.ReadImageFormat