Main Content

mlreportgen.ppt.FontColor Class

Namespace: mlreportgen.ppt

Description

Format that specifies the font color in a presentation.

The mlreportgen.ppt.FontColor class is a handle class.

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

For information on class attributes, see Class Attributes.

Creation

Description

fontColorObj = mlreportgen.ppt.FontColor creates a black font color object.

fontColorObj = mlreportgen.ppt.FontColor(value) sets the Value property to the color specified by value.

example

Properties

expand all

Object identifier for the mlreportgen.ppt.FontColor object, specified as a character vector or string scalar. The PPT API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Tag for the mlreportgen.ppt.FontColor object, specified as a character vector or string scalar. The PPT API generates a session-unique tag 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. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

CSS color name or a hexadecimal RGB value, specified as a character vector or string scalar.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*
ppt = Presentation('myFontColorPresentation.pptx');
open(ppt);
slide = add(ppt,'Title and Content');

Create a paragraph and append text with colored text.

p = Paragraph('Hello World');

tRed = Text(' red text');
tRed.Style = {FontColor('red')};
append(p,tRed);

tBlue = Text(' blue text');
tBlue.Style = {FontColor('#0000ff')};
append(p,tBlue);

Add the paragraph to the slide.

replace(slide,'Content',p);

Close and view the presentation.

close(ppt);
rptview(ppt);

Sample slide with a paragraph that reads "Hello World red text blue text", with "red text" displaying in red and "blue text" displaying in blue

Version History

Introduced in R2015b