jGraduate 0.4
jQuery Plugin for a gradient picker
- Copyright:
- 2010 Jeff Schiller http://blog.codedread.com/, 2010 Alexis Deveria http://a.deveria.com/
- 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}
Adds external:jQuery.jGraduate.Paint
,
external:jQuery.fn.jGraduateDefaults
,
external:jQuery.fn.jGraduate
.
Parameters:
Name | Type | Description |
---|---|---|
$ |
external:jQuery | The jQuery instance to wrap |
Returns:
- Type
- external:jQuery
(inner) mkElem(name, attrs, newparent) → {SVGElement}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
attrs |
module:jGraduate.Attrs | |
newparent |
Element |
Returns:
- Type
- SVGElement
(inner) setAttrs(elem, attrs) → {void}
Parameters:
Name | Type | Description |
---|---|---|
elem |
SVGElement | |
attrs |
module:jGraduate.Attrs |
Returns:
- Type
- void
Type Definitions
Attrs
Type:
- PlainObject.<string, string>
ColorOpac
Object may have one or both values
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
color |
string |
<optional> |
#Hex color |
opac |
Float |
<optional> |
0-1 |
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
|
|||||||||||
images |
PlainObject |
<optional> |
Properties
|
|||||||||||
newstop |
"same" | "inverse" | "black" | "white" | module:jGraduate.ColorOpac |
<optional> |
"inverse" |