ThemeColor

Inheritance: java.lang.Object

public class ThemeColor

Represents a theme color.

Example

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

Constructors

ConstructorDescription
ThemeColor(int type, double tint)

Methods

MethodDescription
equals(Object arg0)
getClass()
getColorType()Gets the theme type.
getTint()Gets the tint value.
hashCode()
notify()
notifyAll()
setColorType(int value)Sets the theme type.
setTint(double value)Sets the tint value.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

ThemeColor(int type, double tint)

public ThemeColor(int type, double tint)

Parameters:

ParameterTypeDescription
typeintThemeColorType. The theme type.
tintdoubleThe tint value.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColorType()

public int getColorType()

Gets the theme type.

See ThemeColorType.

Returns: int

getTint()

public double getTint()

Gets the tint value.

Remarks

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.

Returns: double

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setColorType(int value)

public void setColorType(int value)

Sets the theme type.

See ThemeColorType.

Parameters:

ParameterTypeDescription
valueint

setTint(double value)

public void setTint(double value)

Sets the tint value.

Remarks

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.

Parameters:

ParameterTypeDescription
valuedouble

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int