aspose.cells

Class ThemeColor

Represents a theme color.

Example:

//Instantiating a Workbook object
$workbook = new cells\Workbook();
$cells = $workbook->getWorksheets()->get(0)->getCells();
$cells->get("A1")->putValue("Hello World");
$style = $cells->get("A1")->getStyle();
//Set ThemeColorType.Text2 color type with 40% lighten as the font color
$style->getFont()->setThemeColor(new cells\ThemeColor(cells\ThemeColorType::TEXT_2, 0.4));
$style->setPattern(cells\BackgroundType::SOLID);
//Set ThemeColorType.Background2 color type with 75% darken as the foreground color
$style->setForegroundThemeColor(new cells\ThemeColor(cells\ThemeColorType::BACKGROUND_2, -0.75));
$cells->get("A1")->setStyle($style);

Constructor Summary
ThemeColor(type, tint)
 
Property Getters/Setters Summary
functiongetColorType()
function
           Gets and sets the theme type. The value of the property is ThemeColorType integer constant.
functiongetTint()
function
setTint(value)
           Gets and sets the tint value.
 

    • Constructor Detail

      • ThemeColor

        function ThemeColor(type, tint)
        Parameters:
        type: Number - A ThemeColorType value. The theme type.
        tint: Number - The tint value.
    • Property Getters/Setters Detail

      • getColorType/setColorType : Number 

        function getColorType() / function setColorType(value)
        
        Gets and sets the theme type. The value of the property is ThemeColorType integer constant.
      • getTint/setTint : Number 

        function getTint() / function setTint(value)
        
        Gets and sets the tint value. The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change.