Module: jGraduate

jGraduate 0.4

jQuery Plugin for a gradient picker

License:
  • Apache-2.0
Source:
Examples
// The Paint object is described below.
$.jGraduate.Paint(); // constructs a 'none' color
$.jGraduate.Paint({copy: o}); // creates a copy of the paint o
$.jGraduate.Paint({hex: '#rrggbb'}); // creates a solid color paint with hex = "#rrggbb"
$.jGraduate.Paint({linearGradient: o, a: 50}); // creates a linear gradient paint with opacity=0.5
$.jGraduate.Paint({radialGradient: o, a: 7}); // creates a radial gradient paint with opacity=0.07
$.jGraduate.Paint({hex: '#rrggbb', linearGradient: o}); // throws an exception?

Methods

(static) jGraduate($) → {external:jQuery}

Parameters:
Name Type Description
$ external:jQuery

The jQuery instance to wrap

Source:
Returns:
Type
external:jQuery

(inner) mkElem(name, attrs, newparent) → {SVGElement}

Parameters:
Name Type Description
name string
attrs module:jGraduate.Attrs
newparent Element
Source:
Returns:
Type
SVGElement

(inner) setAttrs(elem, attrs) → {void}

Parameters:
Name Type Description
elem SVGElement
attrs module:jGraduate.Attrs
Source:
Returns:
Type
void

Type Definitions

Attrs

Type:
Source:

ColorOpac

Object may have one or both values

Type:
Properties:
Name Type Attributes Description
color string <optional>

#Hex color

opac Float <optional>

0-1

Source:

Options

Type:
Properties:
Name Type Attributes Default Description
paint module:jGraduate~Paint <optional>

A Paint object object describing the paint to display initially; defaults to a new instance without options (defaults to opaque white)

window external:Window <optional>
Properties
Name Type Attributes Default Description
pickerTitle string <optional>
"Drag markers to pick a paint"
images PlainObject <optional>
Properties
Name Type Attributes Default Description
clientPath string <optional>
"images/"
newstop "same" | "inverse" | "black" | "white" | module:jGraduate.ColorOpac <optional>
"inverse"
Source: