[{"data":1,"prerenderedAt":652},["ShallowReactive",2],{"docs-menu":3,"docs-page:\u002Fdocs\u002Fexamples\u002Fgradients":193},[4,11,108,143],{"title":5,"path":6,"stem":7,"order":8,"summary":9,"exact":10},"Documentation","\u002Fdocs","docs\u002Findex",0,"How to build drawings with Wirepaint's node graph.",true,{"title":12,"order":13,"summary":14,"path":15,"stem":16,"children":17,"page":107,"exact":10},"Guides",1,null,"\u002Fdocs\u002Fguides","docs\u002Fguides",[18,23,29,35,41,47,53,59,65,71,77,83,89,95,101],{"title":19,"path":20,"stem":21,"order":13,"summary":22,"exact":10},"Getting started","\u002Fdocs\u002Fguides\u002Fgetting-started","docs\u002Fguides\u002Fgetting-started","The Playground's areas, and what each one is for.",{"title":24,"path":25,"stem":26,"order":27,"summary":28,"exact":10},"Navigating the editor","\u002Fdocs\u002Fguides\u002Fnavigating-the-editor","docs\u002Fguides\u002Fnavigating-the-editor",2,"Panning, zooming, selecting, moving and deleting in the graph editor.",{"title":30,"path":31,"stem":32,"order":33,"summary":34,"exact":10},"Adding nodes","\u002Fdocs\u002Fguides\u002Fadding-nodes","docs\u002Fguides\u002Fadding-nodes",3,"The add-node menu, its categories and search, and suggested nodes for a dropped link.",{"title":36,"path":37,"stem":38,"order":39,"summary":40,"exact":10},"Connecting pins","\u002Fdocs\u002Fguides\u002Fconnecting-pins","docs\u002Fguides\u002Fconnecting-pins",4,"Drawing wires between pins, replacing and moving them, and which pins fit together.",{"title":42,"path":43,"stem":44,"order":45,"summary":46,"exact":10},"Context menus","\u002Fdocs\u002Fguides\u002Fcontext-menus","docs\u002Fguides\u002Fcontext-menus",5,"The right-click actions for nodes, wires and empty canvas.",{"title":48,"path":49,"stem":50,"order":51,"summary":52,"exact":10},"Property inspector","\u002Fdocs\u002Fguides\u002Fproperty-inspector","docs\u002Fguides\u002Fproperty-inspector",6,"Editing a node's inputs: numbers, switches, text, drop-down lists and object fields.",{"title":54,"path":55,"stem":56,"order":57,"summary":58,"exact":10},"Live preview","\u002Fdocs\u002Fguides\u002Flive-preview","docs\u002Fguides\u002Flive-preview",7,"The drawing's page and its size, what lies outside it, panning and zooming, and downloading the image as SVG.",{"title":60,"path":61,"stem":62,"order":63,"summary":64,"exact":10},"Errors","\u002Fdocs\u002Fguides\u002Ferrors","docs\u002Fguides\u002Ferrors",8,"How the Playground shows a node that fails, and what it means for the drawing.",{"title":66,"path":67,"stem":68,"order":69,"summary":70,"exact":10},"Subgraphs","\u002Fdocs\u002Fguides\u002Fsubgraphs","docs\u002Fguides\u002Fsubgraphs",9,"Create subgraphs, edit their bodies and signatures, and use them as functions for Map, Filter, Reduce and Repeat.",{"title":72,"path":73,"stem":74,"order":75,"summary":76,"exact":10},"Saving and opening","\u002Fdocs\u002Fguides\u002Fsaving-and-opening","docs\u002Fguides\u002Fsaving-and-opening",10,"Keep your work in a file with the File menu, and open it again later.",{"title":78,"path":79,"stem":80,"order":81,"summary":82,"exact":10},"Freezing nodes","\u002Fdocs\u002Fguides\u002Ffreezing-nodes","docs\u002Fguides\u002Ffreezing-nodes",11,"Keep a node's result as it is, whatever happens to its inputs.",{"title":84,"path":85,"stem":86,"order":87,"summary":88,"exact":10},"Text","\u002Fdocs\u002Fguides\u002Ftext","docs\u002Fguides\u002Ftext",12,"Add text to a drawing, pick its font, and place it.",{"title":90,"path":91,"stem":92,"order":93,"summary":94,"exact":10},"Effects","\u002Fdocs\u002Fguides\u002Feffects","docs\u002Fguides\u002Feffects",13,"Shadows, blur, glow, grain, wobbly outlines, color changes, opacity and blend modes on any object.",{"title":96,"path":97,"stem":98,"order":99,"summary":100,"exact":10},"Undo and redo","\u002Fdocs\u002Fguides\u002Fundo-and-redo","docs\u002Fguides\u002Fundo-and-redo",14,"Take back an edit, or put it back, with the Edit menu or Ctrl+Z.",{"title":102,"path":103,"stem":104,"order":105,"summary":106,"exact":10},"Frames","\u002Fdocs\u002Fguides\u002Fframes","docs\u002Fguides\u002Fframes",15,"Draw titled frames around nodes to organize a graph.",false,{"title":109,"order":27,"summary":14,"path":110,"stem":111,"children":112,"page":107,"exact":10},"Concepts","\u002Fdocs\u002Fconcepts","docs\u002Fconcepts",[113,118,123,128,133,138],{"title":114,"path":115,"stem":116,"order":13,"summary":117,"exact":10},"Dataflow and the Output node","\u002Fdocs\u002Fconcepts\u002Fdataflow","docs\u002Fconcepts\u002Fdataflow","How a graph is evaluated, starting from the Output node, and what that means for what you build.",{"title":119,"path":120,"stem":121,"order":27,"summary":122,"exact":10},"Pin types and colors","\u002Fdocs\u002Fconcepts\u002Fpin-types","docs\u002Fconcepts\u002Fpin-types","What a pin's type says, which wires fit, and how colors and handle shapes show it.",{"title":124,"path":125,"stem":126,"order":33,"summary":127,"exact":10},"Generic pins","\u002Fdocs\u002Fconcepts\u002Fgeneric-pins","docs\u002Fconcepts\u002Fgeneric-pins","Pins whose type is set by what you connect, such as the T of the array nodes.",{"title":129,"path":130,"stem":131,"order":39,"summary":132,"exact":10},"Units and coordinates","\u002Fdocs\u002Fconcepts\u002Funits-and-coordinates","docs\u002Fconcepts\u002Funits-and-coordinates","Page coordinates, angles in radians, local and page positions, and the ranges of t, colors and lerps.",{"title":134,"path":135,"stem":136,"order":45,"summary":137,"exact":10},"Determinism and random","\u002Fdocs\u002Fconcepts\u002Fdeterminism","docs\u002Fconcepts\u002Fdeterminism","Why a graph always draws the same thing, how the random nodes fit in, and how to reroll them with seeds.",{"title":139,"path":140,"stem":141,"order":51,"summary":142,"exact":10},"Subgraphs and functions","\u002Fdocs\u002Fconcepts\u002Fsubgraphs","docs\u002Fconcepts\u002Fsubgraphs","Functions are graphs of their own, used as nodes or passed to Map, Filter, Reduce and Repeat.",{"title":144,"order":33,"summary":14,"path":145,"stem":146,"children":147,"page":107,"exact":10},"Examples","\u002Fdocs\u002Fexamples","docs\u002Fexamples",[148,153,158,163,168,173,178,183,188],{"title":149,"path":150,"stem":151,"order":13,"summary":152,"exact":10},"Blending two circles","\u002Fdocs\u002Fexamples\u002Fblending-circles","docs\u002Fexamples\u002Fblending-circles","A row of circles that grows and changes color, from two circles and Lerp.",{"title":154,"path":155,"stem":156,"order":27,"summary":157,"exact":10},"A whirl of squares","\u002Fdocs\u002Fexamples\u002Fwhirl-of-squares","docs\u002Fexamples\u002Fwhirl-of-squares","Squares that turn and shrink one step at a time, with Rotate and Scale.",{"title":159,"path":160,"stem":161,"order":33,"summary":162,"exact":10},"A hexagram from a circle","\u002Fdocs\u002Fexamples\u002Fhexagram","docs\u002Fexamples\u002Fhexagram","Two triangles made from points sampled on a circle, with Sample, Make Polygon and Rotate.",{"title":164,"path":165,"stem":166,"order":39,"summary":167,"exact":10},"Triangles on a grid","\u002Fdocs\u002Fexamples\u002Ftriangles-on-a-grid","docs\u002Fexamples\u002Ftriangles-on-a-grid","A triangle at every point of a grid, each turned a little more, with Orthogonal Grid, Map and a function made with New function…",{"title":169,"path":170,"stem":171,"order":45,"summary":172,"exact":10},"A glowing ball in a gradient frame","\u002Fdocs\u002Fexamples\u002Fgradients","docs\u002Fexamples\u002Fgradients","A ball filled with a radial gradient inside a square with a linear gradient outline, both from the same two color stops.",{"title":174,"path":175,"stem":176,"order":51,"summary":177,"exact":10},"Voronoi tessellation","\u002Fdocs\u002Fexamples\u002Fvoronoi","docs\u002Fexamples\u002Fvoronoi","Organic cell patterns from random points, evened out with Relax Points, and drawn with gaps using Scale and Map.",{"title":179,"path":180,"stem":181,"order":57,"summary":182,"exact":10},"Paper cut-out","\u002Fdocs\u002Fexamples\u002Fpaper-cut-out","docs\u002Fexamples\u002Fpaper-cut-out","Layered paper hills and a sun with wobbly edges, grain and soft shadows, made with the Displace, Noise and Drop Shadow effect nodes.",{"title":184,"path":185,"stem":186,"order":63,"summary":187,"exact":10},"Sierpinski triangle","\u002Fdocs\u002Fexamples\u002Fsierpinski-triangle","docs\u002Fexamples\u002Fsierpinski-triangle","A triangle made of three half-size triangles, each made the same way: a subgraph that calls itself, stopped by a Switch.",{"title":189,"path":190,"stem":191,"order":69,"summary":192,"exact":10},"Metaballs and contour lines","\u002Fdocs\u002Fexamples\u002Fmetaballs","docs\u002Fexamples\u002Fmetaballs","Gooey blobs from charges on a jittered grid, ringed by contour lines, with Zip Point Scalars, Metaballs and Isolines.",{"id":194,"title":169,"body":195,"description":201,"extension":648,"meta":649,"navigation":10,"order":45,"path":170,"seo":650,"stem":171,"summary":172,"__hash__":651},"docs\u002Fdocs\u002Fexamples\u002Fgradients.md",{"type":196,"value":197,"toc":636},"minimark",[198,202,207,210,215,220,228,253,262,280,287,290,294,311,327,334,360,366,369,373,389,403,414,442,448,451,455,483,486,489,493,531,535,608,612],[199,200,201],"p",{},"A ball lit from the top left, inside a square frame that fades from\nyellow to orange. Both gradients use the same two colors, made once and\nshared. Along the way you'll see how gradients are built from color stops,\nand why their points are in the shape's own units.",[203,204],"example-figure",{"alt":205,"example":206},"An orange ball with a pale yellow highlight at its top left, inside a square outline fading from yellow at the top left to orange at the bottom right","gradients",[199,208,209],{},"You'll use: Make ColorStop, Make Array, Make RadialGradient,\nMake LinearGradient, Make Stroke, Make Circle, Make Rectangle, Output.",[211,212,214],"h2",{"id":213},"steps","Steps",[216,217,219],"h3",{"id":218},"_1-make-the-color-stops","1. Make the color stops",[199,221,222,223,227],{},"A gradient blends between ",[224,225,226],"strong",{},"color stops",": a color at an offset from 0 (where\nthe gradient starts) to 1 (where it ends).",[199,229,230,231,234,235,238,239,243,244,248,249,252],{},"Add a ",[224,232,233],{},"Make ColorStop"," node (",[224,236,237],{},"Shift + A",", then ",[240,241,242],"em",{},"Objects → ColorStop →\nMake ColorStop",", or type \"make colorstop\"). Leave its ",[245,246,247],"code",{},"offset"," at 0 and set\nits ",[245,250,251],{},"color"," to r 254, g 240, b 138 (pale yellow).",[199,254,255,256,258,259,261],{},"Add a second Make ColorStop with ",[245,257,247],{}," 1 and ",[245,260,251],{}," r 234, g 88, b 12\n(orange).",[199,263,264,265,234,268,271,272,275,276,279],{},"Gradients take their stops as a list. Add a ",[224,266,267],{},"Make Array",[240,269,270],{},"Array →\nMake Array",") and connect each stop's ",[245,273,274],{},"object"," output to one of its ",[245,277,278],{},"items","\nslots. The first wire makes it an array of ColorStops.",[199,281,282],{},[283,284],"img",{"alt":285,"src":286},"Two Make ColorStop nodes connected to a Make Array node, the first stop selected, with offset 0 and its pale yellow color in the inspector","\u002Fdocs\u002Fexamples\u002Fgradients-stops.png",[199,288,289],{},"Nothing is drawn yet: stops are only colors waiting to be used.",[216,291,293],{"id":292},"_2-fill-a-ball-with-a-radial-gradient","2. Fill a ball with a radial gradient",[199,295,230,296,234,299,302,303,306,307,310],{},[224,297,298],{},"Make RadialGradient",[240,300,301],{},"Objects → RadialGradient → Make\nRadialGradient","). Connect Make Array's ",[245,304,305],{},"array"," output to its ",[245,308,309],{},"stops",", then\nset:",[312,313,314,321],"ul",{},[315,316,317,320],"li",{},[245,318,319],{},"innerCenter",": x −50, y −50;",[315,322,323,326],{},[245,324,325],{},"outerRadius",": 150.",[199,328,329,330,333],{},"A radial gradient goes from an inner circle (offset 0, here a point, since\n",[245,331,332],{},"innerRadius"," stays 0) to an outer circle (offset 1, radius 150 around\n(0, 0)). Moving the inner circle away from the center puts the highlight\noff to one side.",[199,335,336,337,340,341,344,345,348,349,352,353,355,356,359],{},"Now add a ",[224,338,339],{},"Make Circle",", set its ",[245,342,343],{},"position"," to x 500, y 400, its ",[245,346,347],{},"radius","\nto 150 and its stroke's ",[245,350,351],{},"width"," to 0 (no outline). Connect the gradient's\n",[245,354,274],{}," output to the circle's ",[245,357,358],{},"fill",", and the circle to the Output node.",[199,361,362],{},[283,363],{"alt":364,"src":365},"Make RadialGradient connected to the fill of a Make Circle, drawing an orange ball with a yellow highlight; the gradient is selected, showing innerCenter −50, −50 and outerRadius 150","\u002Fdocs\u002Fexamples\u002Fgradients-ball.png",[199,367,368],{},"The gradient's points are in the circle's own units: (0, 0) is the circle's\ncenter, wherever the circle is on the page. Move the circle and the\nhighlight moves with it.",[216,370,372],{"id":371},"_3-frame-it-with-a-gradient-outline","3. Frame it with a gradient outline",[199,374,230,375,378,379,382,383,385,386,388],{},[224,376,377],{},"Make LinearGradient"," (",[240,380,381],{},"Objects → LinearGradient → Make\nLinearGradient",") and connect the same Make Array ",[245,384,305],{}," output to its\n",[245,387,309],{}," too: an output can feed any number of inputs. Set:",[312,390,391,397],{},[315,392,393,396],{},[245,394,395],{},"start",": x −200, y −200;",[315,398,399,402],{},[245,400,401],{},"end",": x 200, y 200.",[199,404,230,405,340,408,410,411,413],{},[224,406,407],{},"Make Stroke",[245,409,351],{}," to 24 and connect the linear\ngradient to its ",[245,412,251],{},".",[199,415,416,417,420,421,423,424,426,427,430,431,433,434,437,438,441],{},"Finally add a ",[224,418,419],{},"Make Rectangle"," with ",[245,422,343],{}," x 500, y 400, ",[245,425,351],{}," 400\nand ",[245,428,429],{},"height"," 400, and set its ",[245,432,358],{},"'s ",[245,435,436],{},"a"," to 0, so only the outline shows.\nConnect the stroke to its ",[245,439,440],{},"stroke"," input, and the rectangle to the next\nfree slot of the Output node.",[199,443,444],{},[283,445],{"alt":446,"src":447},"The finished graph: the stops feed both gradients, the linear gradient feeds Make Stroke, which feeds Make Rectangle; Make LinearGradient is selected, showing start −200, −200 and end 200, 200","\u002Fdocs\u002Fexamples\u002Fgradients-frame.png",[199,449,450],{},"The rectangle is 400 wide around its position, so in its own units its\ncorners are at ±200: the gradient runs exactly from its top-left corner to\nits bottom-right one. The result is the picture at the top.",[211,452,454],{"id":453},"how-it-works","How it works",[199,456,457,459,460,462,463,467,468,472,473,477,478,482],{},[245,458,358],{}," and a stroke's ",[245,461,251],{}," are ",[436,464,466],{"href":465},"\u002Fdocs\u002Ftypes\u002Fpaint","Paints",": a\n",[436,469,471],{"href":470},"\u002Fdocs\u002Ftypes\u002Fcolor","Color",", a\n",[436,474,476],{"href":475},"\u002Fdocs\u002Ftypes\u002Flinear-gradient","LinearGradient"," or a\n",[436,479,481],{"href":480},"\u002Fdocs\u002Ftypes\u002Fradial-gradient","RadialGradient",". Typed in the inspector, they\nare colors; a gradient has to come through a wire.",[199,484,485],{},"A gradient's points and radii are in the units of the shape it's used on,\nbefore its position, rotation and scale. So the same gradient fits any\nshape of the same size, wherever it is, and turns and scales with it.\nBefore the first stop and after the last one, their colors continue: that's\nwhy the ball's edge and the frame's far corner are solid orange.",[199,487,488],{},"Sharing one Make Array between both gradients means changing a stop's color\nchanges the ball and the frame together.",[211,490,492],{"id":491},"nodes-used","Nodes used",[312,494,495,501,506,513,525],{},[315,496,497,500],{},[436,498,233],{"href":499},"\u002Fdocs\u002Ftypes\u002Fcolor-stop",", on the ColorStop type's page.",[315,502,503,413],{},[436,504,267],{"href":505},"\u002Fdocs\u002Fnodes\u002Farray\u002Fmake",[315,507,508,510,511,413],{},[436,509,298],{"href":480}," and\n",[436,512,377],{"href":475},[315,514,515,518,519,510,522,413],{},[436,516,407],{"href":517},"\u002Fdocs\u002Ftypes\u002Fstroke",", ",[436,520,339],{"href":521},"\u002Fdocs\u002Ftypes\u002Fcircle",[436,523,419],{"href":524},"\u002Fdocs\u002Ftypes\u002Frectangle",[315,526,527,413],{},[436,528,530],{"href":529},"\u002Fdocs\u002Fnodes\u002Fcore\u002Foutput","Output",[211,532,534],{"id":533},"variations","Variations",[312,536,537,546,552,589,599],{},[315,538,539,542,543,545],{},[224,540,541],{},"Move the light."," Change the radial gradient's ",[245,544,319],{},": (50, 50)\nlights the ball from the bottom right, (0, 0) from the front.",[315,547,548,551],{},[224,549,550],{},"Hard edges."," Two stops at the same offset make a sharp edge instead\nof a blend. Add two more Make ColorStops at offset 0.5, the first pale\nyellow and the second orange, connected in that order: the ball gets a\npale core with a sharp orange rim. Stops are sorted by offset, so the\nslots' order only matters between stops at the same offset.",[315,553,554,557,558,560,561,564,565,567,568,571,572,575,576,578,579,582,583,585,586,588],{},[224,555,556],{},"Blend two gradients."," Duplicate Make RadialGradient (connect the stops\nto the copy too) and set the copy's ",[245,559,319],{}," to (50, 50). Add a\n",[224,562,563],{},"Lerp RadialGradient",", connect the two gradients to ",[245,566,436],{}," and ",[245,569,570],{},"b"," and its\n",[245,573,574],{},"result"," to the circle's ",[245,577,358],{},". At ",[245,580,581],{},"t"," 0.5 the highlight is in the\nmiddle. Both gradients need as many stops to blend; otherwise the result\nis ",[245,584,436],{}," below 0.5 and ",[245,587,570],{}," from 0.5 on.",[315,590,591,594,595,598],{},[224,592,593],{},"A gradient background."," Draw a page-sized rectangle as in\n",[436,596,54],{"href":597},"\u002Fdocs\u002Fguides\u002Flive-preview#downloading-the-image",", and give it a\nMake LinearGradient fill from (0, −400) to (0, 400) for a 1000 × 800\npage: top to bottom, since (0, 0) is the rectangle's center.",[315,600,601,604,605,607],{},[224,602,603],{},"Gradient lines."," Connect Make Stroke to the ",[245,606,440],{}," of a line, such as\na Make Bezier, for a curve that changes color along the way.",[211,609,611],{"id":610},"see-also","See also",[312,613,614,627,631],{},[315,615,616,518,619,621,622,510,624,413],{},[436,617,618],{"href":465},"Paint",[436,620,476],{"href":475},",\n",[436,623,481],{"href":480},[436,625,626],{"href":499},"ColorStop",[315,628,629,413],{},[436,630,129],{"href":130},[315,632,633,635],{},[436,634,149],{"href":150},", for Lerp nodes.",{"title":637,"searchDepth":27,"depth":27,"links":638},"",[639,644,645,646,647],{"id":213,"depth":27,"text":214,"children":640},[641,642,643],{"id":218,"depth":33,"text":219},{"id":292,"depth":33,"text":293},{"id":371,"depth":33,"text":372},{"id":453,"depth":27,"text":454},{"id":491,"depth":27,"text":492},{"id":533,"depth":27,"text":534},{"id":610,"depth":27,"text":611},"md",{},{"title":169,"description":201},"zHSs3pr7DuH35X2hHBH-G05Pas4NzUqNfp7gXgOVvec",1795082912694]