Skins Library

pergola.skins (defined in lib/skins.js) is an object defining skin function properties. The skin function specified in the configuration file is invoked at runtime. The function defines color scheme related system constants, the presentationAttributes object, and gradients and patterns.

The presentationAttributes object defines properties whose names relate to the Pergola classes, and that's where the respective prototypes initial values are set. This translates in the possibility for the developer to set initial values without needing to hack the classes, or to design a whole new skin, in which case the default (and unique) "rubber" function must be used as template. The function also defines gradients and patterns. Note that to change the look and feel of the interface it's usually enough to change the color scheme (theme in the configuration file).

Read also the Skins and Making A New Skin chapters in the tutorial.



Invokes pergola.color.lab() to define the system's color constants; defines the presentationAttributes object with property names corresponding to the classes names (all lower case); defines and appends gradients and patterns to pergola.defs.