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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
XL.Color.Pack
Packs red, green and blue components in color type.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| XL | 3.5 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| bookRef | The reference to the workbook. Please use XL.LoadBook to load a file. | $ref |
| red | The red color value from 0 to 255. | 255 |
| green | The green color value from 0 to 255. | 255 |
| blue | The blue color value from 0 to 255. | 255 |
Result
Returns color value.
Description
Packs red, green and blue components in color type.Examples
Checks what color value to use for 100% red:
MBS( "XL.Color.Pack"; $$book; 255; 0; 0)
// shows 10 in indexed color mode
// shows 16711680 in RGB mode
Writes sheet with red font:
#create new xls file
Set Variable [$book; Value:MBS( "XL.NewBook"; 0 )]
#create fonts
Set Variable [$redColor; Value:MBS( "XL.Color.Pack"; $book; 255; 0; 0)]
Set Variable [$redFont; Value:MBS( "XL.Book.AddFont"; $book)]
Set Variable [$r; Value:MBS( "XL.Font.SetColor"; $book; $redFont; $redColor)]
#
#create formats
Set Variable [$redFormat; Value:MBS( "XL.Book.AddFormat"; $book)]
Set Variable [$r; Value:MBS( "XL.Format.SetFont"; $book; $redFormat; $redFont)]
#
#create sheet
Set Variable [$sheet; Value:MBS( "XL.Book.AddSheet"; $book; "Sales Receipt")]
#
#add number in red
Set Variable [$r; Value:MBS( "XL.Sheet.CellWriteNumber"; $book; $sheet; 5; 3; 123; $redFormat)]
#
Set Field [Writing data::Output; MBS("XL.Book.Save"; $book; "test.xls")]
Set Variable [$r; Value:MBS("XL.Book.Release"; $book)]
See also
- XL.Book.AddFormat
- XL.Book.GetRGBMode
- XL.Book.Release
- XL.Color.UnPack
- XL.Font.SetColor
- XL.Format.SetFillPattern
- XL.LoadBook
- XL.NewBook
- XL.Sheet.CellWriteNumber
- XL.Sheet.CellWriteText
Example Databases
Created 18th August 2014, last changed 23th June 2015
XL.Book.Version - XL.Color.UnPack
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos