Package org.jivesoftware.smackx.colors
Class ConsistentColor
- java.lang.Object
-
- org.jivesoftware.smackx.colors.ConsistentColor
-
public class ConsistentColor extends java.lang.Object
Implementation of XEP-0392: Consistent Color Generation version 0.6.0.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConsistentColor.ConsistentColorSettings
static class
ConsistentColor.Deficiency
-
Constructor Summary
Constructors Constructor Description ConsistentColor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
floatRgbToInts(float[] floats)
static float[]
RGBFrom(java.lang.CharSequence input)
Return the consistent RGB color value of the input.static float[]
RGBFrom(java.lang.CharSequence input, ConsistentColor.ConsistentColorSettings settings)
Return the consistent RGB color value for the input.
-
-
-
Constructor Detail
-
ConsistentColor
public ConsistentColor()
-
-
Method Detail
-
RGBFrom
public static float[] RGBFrom(java.lang.CharSequence input)
Return the consistent RGB color value of the input. This method uses the defaultConsistentColor.ConsistentColorSettings
.- Parameters:
input
- input string (for example username)- Returns:
- consistent color of that username as RGB values in range [0,1].
- See Also:
RGBFrom(CharSequence, ConsistentColorSettings)
-
RGBFrom
public static float[] RGBFrom(java.lang.CharSequence input, ConsistentColor.ConsistentColorSettings settings)
Return the consistent RGB color value for the input. This method respects the color vision deficiency mode set by the user.- Parameters:
input
- input string (for example username)settings
- the settings for consistent color creation.- Returns:
- consistent color of that username as RGB values in range [0,1].
-
floatRgbToInts
public static int[] floatRgbToInts(float[] floats)
-
-