This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mlreportgen.ppt.FontColor class

Package: mlreportgen.ppt

Font color of presentation element


Specifies the font color of a presentation element.


colorObj = FontColor() creates a black font color object.

colorObj = FontColor(color) creates a font color object based on the specified CSS color name.

Input Arguments

expand all

Font color, specified as a character vector. You can use:

  • The name of a color. The name must be a CSS color name. See

  • Hexadecimal RGB (red, green, blue) color value. 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

expand all

Font color for presentation element, returned as an mlreportgen.ppt.FontColor object.


expand all

This read-only property specifies a hexadecimal RGB color value. For example, '#8b008b' specifies dark magenta. You can use either uppercase or lowercase letters as part of a hexadecimal value.

ID for PPT API object, specified as a character vector. 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. 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.

An example of a reason for specifying your own tag value is to make it easier to identify where an issue occurred during presentation generation.

A CSS color name or a hexadecimal RGB value, specified as a character vector

  • For a list of CSS color names, see

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


collapse all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myFontColorPresentation.pptx';
slides = Presentation(slidesFile);

titleSlide = add(slides,'Title and Content');

Create a paragraph and append text with colored text.

p = Paragraph('Hello World');

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

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

Add the paragraph to the slide and close the presentation.



Open myFontColorPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc

Introduced in R2015b