mlreportgen.ppt.FontColor class

Package: 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 (MATLAB).

Creation

Description

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

example

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

Properties

expand all

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 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.

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

  • For a list of CSS color names, see https://www.crockford.com/wrrrld/color.html.

  • To specify a hexadecimal RGB format, use # as the first character and two-digit hexadecimal numbers for the red, green, and blue values. For example, '#0000ff' specifies blue.

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);

Introduced in R2015b