Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createConicGradient startAngle not working #127

Open
kakha13 opened this issue Sep 4, 2024 · 2 comments
Open

createConicGradient startAngle not working #127

kakha13 opened this issue Sep 4, 2024 · 2 comments

Comments

@kakha13
Copy link

kakha13 commented Sep 4, 2024

Tested on iOS

CODE

<StackLayout width="300" height="300" backgroundColor="black">
      <Canvas ref="canvas" style="width:100%; height:100%" width="300" height="300" @ready="onDraw" />
</StackLayout>
    canvas = args.object
    ctx = canvas.getContext('2d') as CanvasRenderingContext2D;
    canvas.width = canvas.clientWidth;
    canvas.height = canvas.clientHeight;

    const gradient = ctx.createConicGradient(90, canvas.width/2, canvas.height/2);

    // Add five color stops
    gradient.addColorStop(0, 'red');
    gradient.addColorStop(0.25, 'orange');
    gradient.addColorStop(0.5, 'yellow');
    gradient.addColorStop(0.75, 'green');
    gradient.addColorStop(1, 'blue');

    ctx.fillStyle = gradient;
    ctx.fillStyle = gradient;
    ctx.fillRect(20, 20, canvas.width, canvas.width);

gradient
Nothing changes

@triniwiz
Copy link
Member

triniwiz commented Sep 4, 2024

What’s the expected output ?

@kakha13
Copy link
Author

kakha13 commented Sep 4, 2024

What’s the expected output ?

oldnew
I want to get this result but nothing changes.
Changed the colors as I wanted, but I still wrote it so you can check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants