PickedColor

open class PickedColor(source)

Represents the currently selected color in the picker.

This class encapsulates the color as an ARGB integer, its alpha component (scaled to 0-255 range), and its HSV (Hue, Saturation, Value) representation. It provides methods to set the color from various sources (integer, HSV components) and retrieve its components.

The alpha value is stored internally as an integer from 0 to 255, but some methods may accept or return it as a percentage (0-100). The HSV components are stored as a float array:

  • mHsv[0] (Hue): 0-360 degrees
  • mHsv[1] (Saturation): 0.0-1.0
  • mHsv[2] (Value/Brightness): 0.0-1.0

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun getAlpha(): Int
Retrieves the alpha component of the current color.
Link copied to clipboard
@Nullable
open fun getColor(): @Nullable Integer
Returns the current color selected in the picker.
Link copied to clipboard
open fun getV(): Float
Gets the current value (brightness) component of the color in HSV model.
Link copied to clipboard
open fun setAlpha(alpha: Int)
Sets the alpha (transparency) value of the picked color.
Link copied to clipboard
open fun setColor(@NonNull color: @NonNull Integer)
Sets the current color.
Link copied to clipboard
open fun setColorWithAlpha(color: Int, alpha: Int)
Sets the current color and its alpha value.
Link copied to clipboard
open fun setHS(hue: Float, saturation: Float, value: Int)
Sets the hue and saturation of the color, maintaining the current alpha.
Link copied to clipboard
open fun setV(value: Float)
Sets the Value (brightness) component of the color in the HSV model.