JXtension - new Color(hexColor)

Purpose:
Give the user the ability to represent and mutate an HTML hexadecimal color as a JavaScript object.

Parameters:

hexColor The hexadecimal code for the color that is to be represented by a new Color object.  This code may begin with a pound sign (#).  The hexadecimal code must fit one of the following profiles:
  • Three digits - The first digit stands for red, the second for green, and the third for blue:
    • AF8
    • #000
    • #6cf
  • Six digits - The first two digits stand for red, the second two stand for green, and the third for blue:
    • e5FfA9
    • #3FC3A2

Result:
Constructing a JXtension color in this way yields an object which contains the RGB color values for the specified hexadecimal color code.

Example #1:
The following will illustrate how to create a JavaScript (JXtension) color object from hexadecimal color codes:

 

See also: