aboutsummaryrefslogtreecommitdiffstats
path: root/src/elements/Stop.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements/Stop.js')
-rw-r--r--src/elements/Stop.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/elements/Stop.js b/src/elements/Stop.js
index d258b86..d29090c 100644
--- a/src/elements/Stop.js
+++ b/src/elements/Stop.js
@@ -1,6 +1,7 @@
import { nodeOrNew, register } from '../utils/adopter.js'
import Element from './Element.js'
import SVGNumber from '../types/SVGNumber.js'
+import { registerMethods } from '../utils/methods.js'
export default class Stop extends Element {
constructor (node, attrs = node) {
@@ -26,4 +27,13 @@ export default class Stop extends Element {
}
}
+registerMethods({
+ Gradient: {
+ // Add a color stop
+ stop: function (offset, color, opacity) {
+ return this.put(new Stop()).update(offset, color, opacity)
+ }
+ }
+})
+
register(Stop, 'Stop')