Name

swatchview — A simple space-filling colored view.

Synopsis

LZX: swatchview
JavaScript: swatchview
Type: Class
Access: public
Topic: Components.Base Components
Declared in: lps/components/base/swatchview.lzx

Description

A simple view that is filled with a single color. Either 'fgcolor' and 'bgcolor' may be used to set the color of the view. By default it fills the space of the parent with white.

Unlike with other views, setColorTransform will affect the bgcolor of the view.

swatchview is a simple view that is filled with a single color. Either 'fgcolor' and 'bgcolor' may be used to set the color of the view. By default it fills the space of the parent with white

Superclass Chain

node (LzNode) » view (LzView) » swatchview

Known Subclasses

Details

Properties (2)

color
<attribute name="color" value="0xffffff" />
public read-only var color;
this is the color that was set (by setting 'bgcolor' or 'fgcolor' ), bgcolor may be different if setColorTransform has been called
fgcolor
<attribute name="fgcolor" />
public var fgcolor;
setting the fgcolor attribute is equivalent to setting bgcolor

Methods (2)

setBGColor()
<method name="setBGColor" args="c" />
public function setBGColor(c : Number);
sets the bgcolor with the color transform applied
setColorTransform()
<method name="setColorTransform" args="o" />
public function setColorTransform(o : Object);
affects the bgcolor, unlike in regular views where only the resource and subviews are affected by the color transform

LZX Synopsis

<class name="swatchview" extends=" LzView ">
  <attribute name=" color " value="0xffffff" />
  <attribute name=" fgcolor " />
  <method name=" setBGColor " args="c" />
  <method name=" setColorTransform " args="o" />
</class>

JavaScript Synopsis

public swatchview extends  LzView  {
  public read-only var color ;
  public var fgcolor ;
  prototype public function setBGColor (c : Number);
  prototype public function setColorTransform (o : Object);
}