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.dom.BackgroundColor class

Package: mlreportgen.dom
Superclasses:

Background color of document element

Description

Specifies the background color of a document element

Construction

backgroundColorObj = BackgroundColor() creates a white background.

backgroundColorObj = BackgroundColor(colorName) creates a background color object based on the specified CSS color name.

backgroundColorObj = BackgroundColor(rgbValue) creates a background color object using the hexidecimal RGB color value.

Input Arguments

expand all

The name of a color, specified as a character vector. The name must be a CSS color name. See http://www.crockford.com/wrrrld/color.html.

A character vector using the following RGB format: #RRGGBB. Use # as the first character and two-digit hexidecimal numbers for each for the red, green, and blue values. For example, '#0000ff' specifies blue.

Output Arguments

expand all

Background color for a report object, returned as an mlreportgen.dom.BackgroundColor object

Properties

expand all

Hexadecimal number representing an 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 this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for document element, specified as a character vector.

A session-unique ID is generated as part of document element creation. The generated tag has the form CLASS:ID, where CLASS is the class of the element and ID is the value of the Id property of the object. You can specify a tag to replace the generated tag.

For example, to make it easier to identify where an issue occurred during document generation, you can specify your own tag value.

Either a CSS color name or a hexidecimal RGB value, specified as a character vector.

Examples

expand all

Create a deep sky blue background color object and apply it to a paragraph. Instead of specifying the CSS color name DeepSkyBlue, you can use the hexadecimal value #00bfff.

import mlreportgen.dom.*;
     doctype = 'html';
     d = Document('test',doctype);
     blue = 'DeepSkyBlue';
     % blue = '#00BFFF';
     colorfulStyle = {Bold,Color(blue),BackgroundColor('Yellow')};
     p = Paragraph('deep sky blue paragraph with yellow background');
     p.Style = colorfulStyle;
     append(d,p);
     close(d);
     rptview('test',doctype);
Was this topic helpful?