Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Sets the background color of the fill pattern.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XL | 3.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
Book | The reference to the workbook. Please use XL.LoadBook to load a file. | $ref |
Format | The index of the format in the book to target. | 0 |
Value | The new setting. | $value |
Returns OK or error.
Sets the fore color to red:
If [ MBS( "XL.Book.GetRGBMode"; $book) = 0 ]
Set Variable [ $r; Value: MBS( "XL.Format.SetPatternBackgroundColor"; $book; $format; 10) ]
Else
Set Variable [ $c; Value: MBS( "XL.Color.Pack"; $book; 255; 0; 0) ]
Set Variable [ $r; Value: MBS( "XL.Format.SetPatternBackgroundColor"; $book; $format; $c) ]
End If
Set Variable [ $r; Value: MBS( "XL.Format.SetFillPattern"; $book; $format; 1 ) ]
Create a 75% gray pattern with blue and red dots:
# make sure we have RGB mode
Set Variable [ $r ; Value: MBS( "XL.Book.SetRGBMode"; $book; 1 ) ]
#
# Define new format
Set Variable [ $format ; Value: MBS( "XL.Book.AddFormat"; $book) ]
#
# Encode some RGB colors
Set Variable [ $redcolor ; Value: MBS( "XL.Color.Pack"; $book; 255; 0; 0) ]
Set Variable [ $bluecolor ; Value: MBS( "XL.Color.Pack"; $book; 0; 0; 255) ]
#
# set colors for pattern
Set Variable [ $r ; Value: MBS( "XL.Format.SetPatternForegroundColor"; $book; $format; $redcolor) ]
Set Variable [ $r ; Value: MBS( "XL.Format.SetPatternBackgroundColor"; $book; $format; $bluecolor) ]
#
# and have this format fill the pattern
Set Variable [ $r ; Value: MBS( "XL.Format.SetFillPattern"; $book; $format; 3 ) // 75% gray ]
This function checks for a license.
Created 18th August 2014, last changed 2nd November 2021
XL.Format.SetNumFormat - XL.Format.SetPatternForegroundColor