[]
        
(Showing Draft Content)

IInterior

Interface IInterior


public interface IInterior
Represents the interior of an object.

Provides access to the background color and fill pattern of a supported object, such as a cell or range. Use an IInterior instance to configure fill appearance by applying a Color and a Pattern.


 worksheet.getRange("A1").setValue("Test");
 IInterior interior = worksheet.getRange("A1").getInterior();
 interior.setPattern(Pattern.Solid);
 interior.setColor(Color.GetBlue());
 
  • Method Details

    • getColor

      Color getColor()
      Gets the Color of the represented interior.

      Returns the fill color applied to the interior of the object, such as the background color of a cell or range. Use setColor(Color) to change the returned color.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setColor(Color.GetLightBlue());
       Color color = cell.getInterior().getColor();
       
      Returns:
      The Color of the represented interior.
    • setColor

      void setColor(Color value)
      Sets the Color of the represented interior.
      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setColor(Color.FromArgb(100, 100, 100));
       
      Parameters:
      value - The Color of the represented interior.
    • getColorIndex

      int getColorIndex()
      Gets the color of the interior.

      This property returns the interior color as an index value. Use setColorIndex(int) to assign a palette-based interior color, or IRange.getInterior() to access the interior of a cell or range.

      
       IInterior interior = worksheet.getRange("A1").getInterior();
       interior.setColorIndex(3);
       int colorIndex = interior.getColorIndex();
       
      Returns:
      The color index of the interior.
    • setColorIndex

      void setColorIndex(int value)
      Sets the color of the interior.
      
       IInterior interior = worksheet.getRange("A1").getInterior();
       interior.setColorIndex(3);
       
      Parameters:
      value - The color index of the interior.
    • getThemeColor

      ThemeColor getThemeColor()
      Gets the theme color in the applied color scheme that is associated with the specified object.
      
       IInterior interior = worksheet.getRange("A1").getInterior();
       interior.setThemeColor(ThemeColor.Accent1);
       ThemeColor themeColor = interior.getThemeColor();
       
      Returns:
      The theme color in the applied color scheme that is associated with the specified object.
    • setThemeColor

      void setThemeColor(ThemeColor value)
      Sets the theme color in the applied color scheme that is associated with the specified object.

      Use a ThemeColor constant to apply one of the workbook theme colors to the interior. The displayed color follows the active workbook theme.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setThemeColor(ThemeColor.Accent1);
       
      Parameters:
      value - The theme color to apply to the interior.
    • getTintAndShade

      double getTintAndShade()
      Gets a value that lightens or darkens a color.

      The valid number is from -1 (darkest) to 1 (lightest). Zero (0) is neutral.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setThemeColor(ThemeColor.Accent1);
       cell.getInterior().setTintAndShade(0.5);
       double tintAndShade = cell.getInterior().getTintAndShade();
       
      Returns:
      The tint and shade value of the interior color, from -1 (darkest) to 1 (lightest). Zero (0) is neutral.
    • setTintAndShade

      void setTintAndShade(double value)
      Sets a value that lightens or darkens a color.

      The valid number is from -1 (darkest) to 1 (lightest). Zero (0) is neutral.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setThemeColor(ThemeColor.Accent1);
       cell.getInterior().setTintAndShade(0.25);
       
      Parameters:
      value - The tint and shade value of the interior color, from -1 (darkest) to 1 (lightest). Zero (0) is neutral.
    • getPattern

      Pattern getPattern()
      Gets the interior pattern.

      Returns the Pattern applied to the represented interior, such as a cell or range fill. Use setPattern(Pattern) to change the returned pattern.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LightDown);
       Pattern pattern = cell.getInterior().getPattern();
       
      Returns:
      The Pattern of the represented interior.
    • setPattern

      void setPattern(Pattern value)
      Sets the interior pattern.

      Use this method to apply a Pattern to the represented interior, such as a cell or range fill. Use setPatternColor(Color) to specify the color used by the pattern.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.Solid);
       cell.getInterior().setPatternColor(Color.GetWhite());
       
      Parameters:
      value - The Pattern to apply to the represented interior.
    • getPatternColor

      Color getPatternColor()
      Gets the Color of the pattern for the represented interior.

      Returns the foreground color used by the current Pattern on the represented interior. Use setPatternColor(Color) to change the returned color.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LightDown);
       cell.getInterior().setPatternColor(Color.GetWhite());
       Color patternColor = cell.getInterior().getPatternColor();
       
      Returns:
      The Color of the pattern for the represented interior.
    • setPatternColor

      void setPatternColor(Color value)
      Sets the Color of the pattern for the represented interior.
      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LightDown);
       cell.getInterior().setPatternColor(Color.FromArgb(100, 100, 100));
       
      Parameters:
      value - The Color of the pattern for the represented interior.
    • getPatternColorIndex

      int getPatternColorIndex()
      Gets the color of the interior pattern as an index into the current color palette.

      Use this property to read the palette-based color index applied to the current interior pattern. The returned value can also be a special value from ColorDataIndex, such as ColorDataIndex.Automatic or ColorDataIndex.None.

      
       IInterior interior = worksheet.getRange("A1").getInterior();
       interior.setPattern(Pattern.Solid);
       interior.setPatternColorIndex(10);
       int patternColorIndex = interior.getPatternColorIndex();
       
      Returns:
      The color index of the interior pattern in the current color palette, or a special value from ColorDataIndex.
    • setPatternColorIndex

      void setPatternColorIndex(int value)
      Sets the color of the interior pattern as an index into the current color palette.

      Use this property to set the palette-based color index applied to the current interior pattern.

      
       IInterior interior = worksheet.getRange("A1").getInterior();
       interior.setPattern(Pattern.Solid);
       interior.setPatternColorIndex(10);
       
      Parameters:
      value - The color index of the interior pattern in the current color palette, or a special value from ColorDataIndex.
    • getPatternThemeColor

      ThemeColor getPatternThemeColor()
      Gets a theme color pattern for an Interior object.

      Use this property to read the theme color applied to the pattern foreground of the interior. Pattern theme colors are typically used together with a patterned fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LightDown);
       cell.getInterior().setPatternThemeColor(ThemeColor.Accent1);
       ThemeColor themeColor = cell.getInterior().getPatternThemeColor();
       
      Returns:
      The theme color used for the interior pattern.
    • setPatternThemeColor

      void setPatternThemeColor(ThemeColor value)
      Sets a theme color pattern for an Interior object.

      Use this method to assign a ThemeColor to the pattern foreground of the interior fill.

      
       IInterior interior = worksheet.getRange("A1").getInterior();
       interior.setPattern(Pattern.Gray25);
       interior.setPatternThemeColor(ThemeColor.Accent5);
       
      Parameters:
      value - The theme color to apply to the pattern foreground. Must not be null.
    • getPatternTintAndShade

      double getPatternTintAndShade()
      Gets the tint and shade value of the interior pattern.

      Use this property to read how the current pattern color is lightened or darkened. The valid number is from -1 (darkest) to 1 (lightest). Zero (0) is neutral.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LightDown);
       cell.getInterior().setPatternThemeColor(ThemeColor.Accent1);
       cell.getInterior().setPatternTintAndShade(0.25);
       double patternTintAndShade = cell.getInterior().getPatternTintAndShade();
       
      Returns:
      The tint and shade value of the interior pattern, from -1 (darkest) to 1 (lightest). Zero (0) is neutral.
    • setPatternTintAndShade

      void setPatternTintAndShade(double value)
      Sets the tint and shade value of the interior pattern.

      Use this property to set how the current pattern color is lightened or darkened.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LightDown);
       cell.getInterior().setPatternThemeColor(ThemeColor.Accent1);
       cell.getInterior().setPatternTintAndShade(0.25);
       
      Parameters:
      value - The tint and shade value of the interior pattern, from -1 (darkest) to 1 (lightest). Zero (0) is neutral.
    • getGradient

      Object getGradient()
      Gets the Gradient property of an Interior object of a selection.

      Returns the gradient definition for the interior when the pattern is set to Pattern.LinearGradient or Pattern.RectangularGradient. The returned object is an ILinearGradient for a linear gradient pattern or an IRectangularGradient for a rectangular gradient pattern. Returns null if the interior does not use a gradient pattern.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.LinearGradient);
       ILinearGradient gradient = (ILinearGradient) cell.getInterior().getGradient();
       
      Returns:
      The gradient object for the interior. Returns ILinearGradient or IRectangularGradient depending on the current pattern, or null if no gradient pattern is applied.