public final class ScrollUtils
extends java.lang.Object
| 修飾子とタイプ | メソッドと説明 |
|---|---|
static void |
addOnGlobalLayoutListener(android.view.View view,
java.lang.Runnable runnable)
Add an OnGlobalLayoutListener for the view.
|
static float[] |
cmykFromRgb(int rgbColor)
Convert RGB color to CMYK color.
|
static int |
getColorWithAlpha(float alpha,
int baseColor)
Create a color integer value with specified alpha.
|
static float |
getFloat(float value,
float minValue,
float maxValue)
Return a float value within the range.
|
static int |
mixColors(int fromColor,
int toColor,
float toAlpha)
Mix two colors.
|
static int |
rgbFromCmyk(float[] cmyk)
Convert CYMK color to RGB color.
|
public static float getFloat(float value,
float minValue,
float maxValue)
value - the target valueminValue - minimum value. If value is less than this, minValue will be returnedmaxValue - maximum value. If value is greater than this, maxValue will be returnedpublic static int getColorWithAlpha(float alpha,
int baseColor)
alpha - alpha value from 0.0f to 1.0f.baseColor - base color. alpha value will be ignored.public static void addOnGlobalLayoutListener(android.view.View view,
java.lang.Runnable runnable)
ViewTreeObserver.OnGlobalLayoutListener().
This also handles removing listener when onGlobalLayout is called.view - the target view to add global layout listenerrunnable - runnable to be executed after the view is laid outpublic static int mixColors(int fromColor,
int toColor,
float toAlpha)
toColor will be toAlpha/1 percent,
and fromColor will be (1-toAlpha)/1 percent.fromColor - first color to be mixedtoColor - second color to be mixedtoAlpha - alpha value of toColor, 0.0f to 1.0f.public static float[] cmykFromRgb(int rgbColor)
rgbColor - target colorpublic static int rgbFromCmyk(float[] cmyk)
cmyk - target CYMK color. Each value should be between 0.0f to 1.0f,
and should be set in this order: cyan, magenta, yellow, black.