Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.ppt.FontColor class

Package: mlreportgen.ppt
Superclasses:

Font color of presentation element

Description

Specifies the font color of a presentation element.

Construction

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 http://www.crockford.com/wrrrld/color.html.

  • Hexadecimal RGB (red, green, blue) color value. Use the format #RRGGBB. Use # as the first character and two-digit hexidecimal numbers for each the red, green, and blue value. For example, '#0000ff' specifies blue.

Output Arguments

expand all

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

Properties

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 http://www.crockford.com/wrrrld/color.html.

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

Examples

expand 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')};
append(p,tRed);

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

Add the paragraph to the slide and close the presentation.

replace(titleSlide,'Content',p);

close(slides);

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

if ispc
    winopen(slidesFile);
end

Introduced in R2015b

Was this topic helpful?