Manual and Documentation

NOTE: This manual describes HammerKit version 3.5. To view documentation for the current release of HammerKit Studio, please go to http://manual.hammerkit.com/
search
Index / D. Object API / Classes / HammerKit_Color

A. Introduction
B. Installation and Configuration
C. Using HammerKit tools
D. Object API
Classes
Button
FileUtils
HammerKit_BasicFile
HammerKit_Color
HammerKit_ColorPalette
HammerKit_Component
HammerKit_Converter
HammerKit_CssRule
HammerKit_Db
HammerKit_DbQueryResult
HammerKit_Document
HammerKit_Element
HammerKit_File
HammerKit_GenericObject
HammerKit_Image
HammerKit_Keyword
HammerKit_ObjectCache
HammerKit_ObjectList
HammerKit_Session
HammerKit_Shortcut
HammerKit_Site
HammerKit_System
HammerKit_User
HammerKit_UserGroup
HammerKit_VariableHandler
Style
Interfaces
Object Choosers
Global Variables
Modules
Tools
Converters
Using the API
E. HammerScript
F. Access Rights
HammerKit_Color


Implements interface: HammerKit_ObjectInterface

This class describes and contains the functionality for adding, removing and managing colors and their attributes. A color is identified by its database id, which is an integer number, or a six character long hexadecimal color value with a leading #-sign.



Attributes

string description
Description: The user specified description for the color.
Settable: yes

integer[3] hsl
Description: The hue, saturation and lightness values of the color in an array where the first index 0 contains the value for hue, index 1 contains the value for saturation and index 2 contains the value for lightness.
Settable: no

unique integer id
Description: The database id number of the color.
Settable: no

string name
Description: The user specified name of the color.
Settable: yes

integer palette_id
Description: The id of the color palette this color belongs to.
Settable: yes

integer[3] rgb
Description: The red, green and blue values of the color in an array where the first index 0 contains the value for red, index 1 contains the value for green and index 2 contains the value for blue.
Settable: no

string value
Description: The value of the color as a six character long hexadecimal color value with a leading #-sign.
Settable: yes


Methods

static HammerKit_Color add(array attributes)
Description: see the description of the HammerKit_ObjectInterface interface

string getAttribute(string attribute [, boolean formatted [, array format_options]])
Description: see the description of the HammerKit_ObjectInterface interface

static array getAttributeList([string property])
Description: see the description of the HammerKit_ObjectInterface interface

integer[3] getHsl(void)
Description: get the hue, saturation and lightness of the color with hue values ranging from 0 to 359 and saturation and lightness values ranging from 0 to 100
Returns: an array where index 0 is the hue, index 1 is the saturation and index 2 is the lightness of the color value

static HammerKit_Color getInstance(integer id)
Description: see the description of the HammerKit_ObjectInterface interface

static HammerKit_ObjectList:HammerKit_Color getList([array where])
Description: see the description of the HammerKit_ObjectInterface interface

integer[3] getRgb(void)
Description: get the red, green and blue components of the color with values ranging from 0 to 255
Returns: an array where index 0 is the red, index 1 is the green and index 2 is the blue component of the color value

boolean remove(void)
Description: see the description of the HammerKit_ObjectInterface interface

boolean setAttribute(string name, mixed value)
Description: see the description of the HammerKit_ObjectInterface interface

boolean setAttributes(array attributes)
Description: see the description of the HammerKit_ObjectInterface interface



� HammerKit Oy 2008 UPDATED: 26.01.2009 15:40