swatch
Description
Provides 2-dimensional selection and display of colors, representing hue along the horizontal axis and lightness along the vertical axis. A third color dimension, saturation, may be set by means of the
message.Examples

Arguments
None.
Attributes
compatibility [int] (default: 0)
Toggles the number input and output of the swatch object to be in the range of 0.-1.0 floating-point values (0, default) or to old-style 0-255 integer values (1).
parameter_enable [int]
Enables use of this object with Max for Live Parameters and allows for setting initial parameter values in the Max environment.
parameter_mappable [int] (default: 1)
When parameter_mappable is enabled, the object will be available for mapping to keyboard or MIDI input using the Mappings feature.
saturation [float] (default: 255.)
Set the saturation of available swatch colors
Common Box Attributes
Parameter Attributes
Messages
bang
int
Arguments
Note: Unlike most Max objects, input to any one of the three inlets will re-calculate the current color location on the swatch, and trigger output.
(inlet1)
Arguments
Note: Unlike most Max objects, input to any one of the three inlets will re-calculate the current color location on the swatch, and trigger output.
(inlet2)
Arguments
Note: Unlike most Max objects, input to any one of the three inlets will re-calculate the current RGBA color location on the swatch, and trigger output.
float
Arguments
(inlet1)
Arguments
(inlet2)
Arguments
list
Arguments
green [number]
blue [number]
alpha [number]
alpha
Arguments
hsl
Arguments
saturation [int]
lightness [int]
(mouse)
set
Arguments
green [number]
blue [number]
alpha [number]
sethsl
Arguments
saturation [int]
lightness [int]
Output
int
Out right outlet: the current saturation value (calculated from an RGB list input, or output directly after a
message)list
Out left outlet: a list of four RGBA (red, green, blue, alpha) color values
See Also
Name | Description |
---|---|
colorpicker | |
panel | |
Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals | Max JS Tutorial 3: JavaScript Tasks, Arguments, and Globals |