Klasse Color
java.lang.Object
ch.nolix.system.element.base.AbstractElement
ch.nolix.system.graphic.color.Color
A
Color is not mutable.- Autor:
- Silvan Wyss
-
Feldübersicht
FelderModifikator und TypFeldBeschreibungstatic final intstatic final shortstatic final longstatic final shortstatic final long -
Methodenübersicht
Modifikator und TypMethodeBeschreibungstatic ColorcreateAverageFrom(IContainer<IColor> colors) static ColorcreateAverageFrom(IColor color, IColor... colors) static Colorstatic ColorfromLong(long pLong) static ColorfromSpecification(INode<?> specification) static ColorfromString(String string) doubleintIContainer<INode<?>> doubleintdoubleintdoubleintbooleanbooleanbooleanbooleanintlongtoLong()withAlphaValue(int alphaValue) withFloatingPointAlphaValue(double floatingPointAlphaValue) static ColorwithRedValueAndGreenValueAndBlueValue(int redValue, int greenValue, int blueValue) static ColorwithRedValueAndGreenValueAndBlueValueAndAlphaValue(int redValue, int greenValue, int blueValue, int alphaValue) Von Klasse geerbte Methoden AbstractElement
equals, getSpecification, hashCode, toStringVon Schnittstelle geerbte Methoden IElement
getSpecification, toFormatedString, toXml
-
Felddetails
-
DEFAULT_ALPHA_VALUE
public static final int DEFAULT_ALPHA_VALUE- Siehe auch:
-
MIN_COLOR_LONG
public static final long MIN_COLOR_LONG- Siehe auch:
-
MAX_COLOR_LONG
public static final long MAX_COLOR_LONG- Siehe auch:
-
MIN_COLOR_COMPONENT
public static final short MIN_COLOR_COMPONENT- Siehe auch:
-
MAX_COLOR_COMPONENT
public static final short MAX_COLOR_COMPONENT- Siehe auch:
-
-
Methodendetails
-
createAverageFrom
-
createAverageFrom
-
fromColor
- Parameter:
color-- Gibt zurück:
- a new
Colorfrom the given color. - Löst aus:
NullPointerException- if the given color is null.
-
fromLong
- Parameter:
pLong-- Gibt zurück:
- a new
Colorfrom the given pLong. - Löst aus:
UnrepresentingArgumentException- if the given pLong does not represent aColor.
-
fromSpecification
- Parameter:
specification-- Gibt zurück:
- a new
Colorfrom the given specification - Löst aus:
InvalidArgumentException- if the given specification is not valid.
-
fromString
- Parameter:
string-- Gibt zurück:
- a new
Colorfrom the given string. - Löst aus:
UnrepresentingArgumentException- if the given string does not represent aColor.
-
withRedValueAndGreenValueAndBlueValue
public static Color withRedValueAndGreenValueAndBlueValue(int redValue, int greenValue, int blueValue) - Parameter:
redValue-greenValue-blueValue-- Gibt zurück:
- a new
Colorwith the given redValue, greenValue and blueValue. - Löst aus:
ArgumentIsOutOfRangeException- if the given blueValue is not a true color component (in [0, 255]).ArgumentIsOutOfRangeException- if the given greenValue is not a true color component (in [0, 255]).ArgumentIsOutOfRangeException- if the given blueValue is not a true color component (in [0, 255]).
-
withRedValueAndGreenValueAndBlueValueAndAlphaValue
public static Color withRedValueAndGreenValueAndBlueValueAndAlphaValue(int redValue, int greenValue, int blueValue, int alphaValue) - Parameter:
redValue-greenValue-blueValue-alphaValue-- Gibt zurück:
- a new
Colorwith the given redValue, greenValue, blueValue and alphaValue. - Löst aus:
ArgumentIsOutOfRangeException- if the given blueValue is not a true color component (in [0, 255]).ArgumentIsOutOfRangeException- if the given greenValue is not a true color component (in [0, 255]).ArgumentIsOutOfRangeException- if the given blueValue is not a true color component (in [0, 255]).ArgumentIsOutOfRangeException- if the given alphaValue is not a true color component (in [0, 255]).
-
getAlphaPercentage
public double getAlphaPercentage()- Angegeben von:
getAlphaPercentagein SchnittstelleIColor- Gibt zurück:
- the alpha value of the current
IColoras percentage. A percentage is a number in the range [0.0, 1.0].
-
getAlphaValue
public int getAlphaValue()- Angegeben von:
getAlphaValuein SchnittstelleIColor- Gibt zurück:
- the alpha value of the current
IColor.
-
getAttributes
- Angegeben von:
getAttributesin SchnittstelleIElement- Gibt zurück:
- the attributes of the current
IElement.
-
getBluePercentage
public double getBluePercentage()- Angegeben von:
getBluePercentagein SchnittstelleIColor- Gibt zurück:
- the blue value of the current
IColoras percentage. A percentage is a number in the range [0.0, 1.0].
-
getBlueValue
public int getBlueValue()- Angegeben von:
getBlueValuein SchnittstelleIColor- Gibt zurück:
- the blue value of the current
IColor.
-
getColorNameOrHexadecimalString
- Angegeben von:
getColorNameOrHexadecimalStringin SchnittstelleIColor- Gibt zurück:
- the color name or a hexadecimal
Stringrepresentation of the currentIColor.
-
getGreenPercentage
public double getGreenPercentage()- Angegeben von:
getGreenPercentagein SchnittstelleIColor- Gibt zurück:
- the green value of the current
IColoras percentage. A percentage is a number in the range [0.0, 1.0].
-
getGreenValue
public int getGreenValue()- Angegeben von:
getGreenValuein SchnittstelleIColor- Gibt zurück:
- the green value of the current
IColor.
-
getInvertedColor
-
getRedPercentage
public double getRedPercentage()- Angegeben von:
getRedPercentagein SchnittstelleIColor- Gibt zurück:
- the red value of the current
IColoras percentage. A percentage is a number in the range [0.0, 1.0].
-
getRedValue
public int getRedValue()- Angegeben von:
getRedValuein SchnittstelleIColor- Gibt zurück:
- the red value of the current
IColor.
-
hasFullAlphaValue
public boolean hasFullAlphaValue()- Angegeben von:
hasFullAlphaValuein SchnittstelleIColor- Gibt zurück:
- true if the current
IColorhas a full alpha value, false otherwise.
-
hasFullBlueValue
public boolean hasFullBlueValue()- Angegeben von:
hasFullBlueValuein SchnittstelleIColor- Gibt zurück:
- true if the current
IColorhas a full blue value, false otherwise.
-
hasFullGreenValue
public boolean hasFullGreenValue()- Angegeben von:
hasFullGreenValuein SchnittstelleIColor- Gibt zurück:
- true if the current
IColorhas a full green value, false otherwise.
-
hasFullRedValue
public boolean hasFullRedValue()- Angegeben von:
hasFullRedValuein SchnittstelleIColor- Gibt zurück:
- true if the current
IColorhas a full red value, false otherwise.
-
toAlphaRedGreenBlueInt
public int toAlphaRedGreenBlueInt()- Angegeben von:
toAlphaRedGreenBlueIntin SchnittstelleIColor- Gibt zurück:
- an integer representation of the current
IColorwith the schema alpha-red-green-blue.
-
toHexadecimalString
- Angegeben von:
toHexadecimalStringin SchnittstelleIColor- Gibt zurück:
- a hexadecimal
Stringrepresentation of the currentIColor.
-
toHexadecimalStringWithAlphaValue
- Angegeben von:
toHexadecimalStringWithAlphaValuein SchnittstelleIColor- Gibt zurück:
- a hexadecimal with alpha value
Stringrepresentation of the currentIColor.
-
toLong
-
withFloatingPointAlphaValue
- Angegeben von:
withFloatingPointAlphaValuein SchnittstelleIColor- Parameter:
floatingPointAlphaValue-- Gibt zurück:
- a new
IColorfrom the currentIColorwith the given floatingPointAlphaValue.
-
withFullAlphaValue
- Angegeben von:
withFullAlphaValuein SchnittstelleIColor- Gibt zurück:
- a new
IColorfrom the currentIColorwith a full alpha value.
-
withAlphaValue
- Angegeben von:
withAlphaValuein SchnittstelleIColor- Parameter:
alphaValue-- Gibt zurück:
- a new
IColorfrom the currentIColorwith the given alphaValue.
-