gradient-radial-one-point.js

total 0
used 0
limit 0
/* title: Radial Gradient (1 Point) category: gradient files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/extras.js ../point_src/math.js ../point_src/point-content.js ../point_src/stage.js ../point_src/point.js ../point_src/distances.js ../point_src/pointlist.js ../point_src/events.js ../point_src/functions/clamp.js ../point_src/functions/within.js ../point_src/random.js ../point_src/dragging.js ../point_src/setunset.js ../point_src/stroke.js ../point_src/automouse.js ../point_src/gradient.js --- In this example we create a radial gradient with _one_ point, allowing a simple colour gradient from the x/y of the origin. Notice the x/y of the stop points is not relevant - only the color. */ class MainStage extends Stage { canvas='playspace' mounted(){ let c = this.center c.radius = 200 this.point = c.copy() this.innerPoint = c.copy() this.outerPoint = c.copy().update({radius: 70}) // this.g = (new Gradient).radial(this.innerPoint, this.outerPoint) this.g = (new Gradient).radial(this.outerPoint) // this.dragging.add( this.innerPoint, this.outerPoint, this.point) this.g.addStops({ 0: {color:"hsl(299deg 62% 44%)"}, 1: {color: "hsl(244deg 71% 56%)"} // dark }) } draw(ctx){ this.clear(ctx) this.g.radial() // refresh hack. let grad = this.g.getObject(ctx) this.point.pen.fill(ctx, grad) this.innerPoint.pen.fill(ctx, 'white', 2) this.innerPoint.pen.circle(ctx, undefined, 'white', 1) this.outerPoint.pen.circle(ctx, undefined, '#DDD', 1) } } ;stage = MainStage.go();
Run
Meta Data
title Radial Gradient (1 Point)
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/extras.js', '../point_src/math.js', '../point_src/point-content.js', '../point_src/stage.js', '../point_src/point.js', '../point_src/distances.js', '../point_src/pointlist.js', '../point_src/events.js', '../point_src/functions/clamp.js', '../point_src/functions/within.js', '../point_src/random.js', '../point_src/dragging.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/automouse.js', '../point_src/gradient.js')
unused_keys ()
unknown_keys ('category',)
category ['gradient']
filepath_exists True
path gradient-radial-one-point.js
filepath gradient-radial-one-point.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/extras.js', '../point_src/math.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/distances.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/events.js', '../point_src/functions/clamp.js', '../point_src/functions/within.js', '../point_src/random.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/automouse.js', '../point_src/gradient.js')
markdown {'html': '<hr />\n<p>In this example we create a radial gradient with <em>one</em> point, allowing a simple\ncolour gradient from the x/y of the origin.</p>\n<p>Notice the x/y of the stop points is not relevant - only the color.</p>', 'content': 'title: Radial Gradient (1 Point)\ncategory: gradient\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/extras.js\n ../point_src/math.js\n ../point_src/point-content.js\n ../point_src/stage.js\n ../point_src/point.js\n ../point_src/distances.js\n ../point_src/pointlist.js\n ../point_src/events.js\n ../point_src/functions/clamp.js\n ../point_src/functions/within.js\n ../point_src/random.js\n ../point_src/dragging.js\n ../point_src/setunset.js\n ../point_src/stroke.js\n ../point_src/automouse.js\n ../point_src/gradient.js\n\n---\n\nIn this example we create a radial gradient with _one_ point, allowing a simple\ncolour gradient from the x/y of the origin.\n\nNotice the x/y of the stop points is not relevant - only the color.'}