Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
Angle gradient SVG using paper.js

I'm using paper.js to create gradient forms. From the examples below i have found the way to do the Linear Gradient and the Radial Gradient, but i have not found any example or orientation to do Angle Gradient with paper.js and SVG, is this even possible?

enter image description here

Here are the 2 examples i have found in the oficial paper.js site to create Lnear and Radial Gradient and the code to achieve this forms.

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Gradients</title>
    <link rel="stylesheet" href="../css/style.css">
    <!-- IE 9: display inline SVG -->
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <script type="text/javascript" src="../../dist/paper-full.js"></script>
    <script type="text/paperscript" canvas="canvas">
        var stops = [new Color(1, 1, 0, 0), 'red', 'black'];

        var radius = view.bounds.width * 0.4,
            from = new Point(view.center.x),
            to = from + [radius, 0];

        var circle = new Path.Circle({
            center: from,
            radius: radius,
            fillColor: {
                stops: stops,
                radial: true,
                origin: from,
                destination: to
            },
            strokeColor: 'black'
        });

        var from = view.bounds.leftCenter,
            to = view.bounds.bottomRight;

        var rect = new Path.Rectangle({
            from: from,
            to: to,
            fillColor: {
                stops: stops,
                radial: false,
                origin: from,
                destination: to
            },
            strokeColor: 'black'
        });

        //rect.rotate(45).scale(0.7);

        document.body.appendChild(project.exportSVG());
    </script>
</head>
<body>
    <canvas id="canvas" width="300" height="600"></canvas>
</body>
</html>

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

no unfortunately, this is not supported by Paper.js.
And there are low chances that it supports it soon, unless the Canvas API itself (which Paper.js uses to draw) supports it. Maybe you can find a workaround here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!