mlreportgen.ppt.BackgroundColor class
Package: mlreportgen.ppt
Background color of presentation element
Description
Specifies the background color of these presentation element PPT API objects:
TextBox
TextBoxPlaceholder
ContentPlaceholder
TablePlaceholder
Table
TableRow
TableEntry
ColSpec
TextBox
Construction
creates a white background.backgroundColorObj
= BackgroundColor()
creates a background color object based on the specified CSS color name or hexadecimal
RGB color value.backgroundColorObj
= BackgroundColor(color
)
Input Arguments
color
— Background color
character vector
Background color, specified as a character vector. You can use:
The name of a color, specified as a character vector. The name must be a CSS color name. See https://www.w3.org/wiki/CSS/Properties/color/keywords.
Hexadecimal RGB (red, green, blue) color value, specified as a character vector. Use the format
#RRGGBB
. Use#
as the first character and two-digit hexadecimal numbers each for the red, green, and blue values. For example,'#0000ff'
specifies blue.
Output Arguments
backgroundColorObj
— Background color
mlreportgen.ppt.BackgroundColor
object
Background color for a report object, returned as an
mlreportgen.ppt.BackgroundColor
object.
Properties
Id
— ID for this PPT API object
character vector | string scalar
ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.
Tag
— Tag for this PPT API object
character vector | string scalar
Tag for this PPT API object, specified as a character vector or string scalar. A
session-unique tag is generated as part of the creation of this object. The generated
tag has the form CLASS:ID
, where CLASS
is the
object class and ID
is the value of the Id
property of the object.
Specifying your own tag value can help you to identify where an issue occurred during presentation generation.
Value
— CSS color name or hexadecimal RGB value for this color
character vector
The name of a color, specified as a character vector, using one of these values:
A CSS color name. See https://www.w3.org/wiki/CSS/Properties/color/keywords.
An RGB value, using a character vector having the format
#RRGGBB
. Use#
as the first character and two-digit hexadecimal numbers each for the red, green, and blue values. For example,'#0000ff'
specifies blue.
Examples
Use Background Colors in a Table
Create a table with different color rows and table entries.
Set up a presentation with a slide titled A Colorful
Table
.
import mlreportgen.ppt.* ppt = Presentation('myBackground.pptx'); open(ppt); slide1 = add(ppt,'Title and Content'); replace(slide1,'Title','A Colorful Table');
Define the table, specifying different colors for the top row and for the first entry in the second row.
table1 = Table(); row1 = TableRow(); row1.Style = {BackgroundColor('beige')}; row1entry1 = TableEntry(); p2 = Paragraph('Beige row'); append(row1entry1,p2); row1entry2 = TableEntry(); p3 = Paragraph('More text'); append(row1entry2,p3); append(row1,row1entry1); append(row1,row1entry2); row2 = TableRow(); row2entry1 = TableEntry(); row2entry1.Style = {BackgroundColor('yellow')}; p4 = Paragraph('yellow cell'); append(row2entry1,p4); row2entry2 = TableEntry(); p5 = Paragraph('default white background'); append(row2entry2,p5); append(row2,row2entry1); append(row2,row2entry2); append(table1,row1); append(table1,row2);
Replace the slide content with the table, generate the presentation, and
open the myBackground
presentation.
replace(slide1,'Content',table1);
close(ppt);
rptview(ppt);
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)