ColorSampler A color sampler for a document. Access through the Document.colorSamplers collection.
For example: var colorSamplerRef = app.activeDocument.colorSamplers[0]; var currentColor = colorSamplerRef.color; Note: For additional information about color samplers, see Adobe Photoshop CS4 help on the Color SamplerTool.
Properties Methods Property Value type What it is color SolidColor Read-only. The color of the color sampler. position array of UnitValue Read-only. The position of the color sampler in the document. The array (x,y) represents the horizontal and vertical location of the count item. parent Document Read-only. The containing document. typename string Read-only. The class name of the referenced ColorSampler object. Method Parameter type Returns What it does move (position) array of UnitValue Moves the color sampler to a new location in the document. The position parameter (x,y) represents the new horizontal and vertical locations of the moved color sampler. remove () Deletes the ColorSampler object.
ColorSamplers The collection of ColorSampler objects in a document. Access through the Document.colorSamplers collection property.
For example: app.activeDocument.colorSamplers.removeAll() Properties Methods Property Value type What it is length number Read-only. The number of elements in the ColorSamplers collection. parent Document Read-only. The containing document. typename string Read-only. The class name of the referenced ColorSamplers object. Method Parameter type Returns What it does add (position) array of UnitValue ColorSampler Creates a new color sampler object and adds it to this collection. The position parameter (x,y) represents the new horizontal and vertical locations of the moved color sampler. removeAll () Removes all ColorSampler objects from the ColorSamplers collection