Skip to content

Conversation

@pingbird
Copy link
Member

@pingbird pingbird commented Sep 8, 2022

This PR adds diagrams for Canvas.clipRect, Canvas.clipRRect, Canvas.clipPath, Canvas.drawLine, Canvas.drawRect, Canvas.drawRRect, Canvas.drawOval, Canvas.drawCircle, Path.conicTo, Path.cubicTo, Path.quadraticBezierTo, Radius.circular, and Radius.elliptical

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are really awesome!

Can you perhaps change them so that they are transparent PNGs? One thing that would be nice is if we can have them work for both light and dark mode docs pages, since that's something that they will soon respect.

It might be possible to choose (probably not black or white) colors/transparencies that will be readable over either a black background or a white background. I realize that might be a tall order, but since we don't have a good way to swap the assets based on the dark mode setting yet, seems like the best solution for now.

bool shouldRepaint(LineDiagramPainter oldDelegate) => true;
}

class RectCtorDiagramPainter extends CustomPainter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class RectCtorDiagramPainter extends CustomPainter {
class RectConstructorDiagramPainter extends CustomPainter {

We try not to use abbreviations in names.

@gspencergoog
Copy link
Contributor

And if it isn't straightforward to generate an RGBA PNG (which it might not be), then we can also leave that for another time.

@pingbird
Copy link
Member Author

pingbird commented Sep 8, 2022

It's totally possible to make them transparent! The white background was added intentionally to not break dark backgrounds.

I'm not sure if there's a good theme that works for both though, here's what I have so far:

image

image

image

image

@gspencergoog
Copy link
Contributor

I think that works great! Ship it!

@pingbird
Copy link
Member Author

pingbird commented Sep 8, 2022

@gspencergoog re-generated them with the new color palette! let me know if we need any further tweaks

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Thanks so much!

@pingbird pingbird merged commit 7063e30 into flutter:master Sep 8, 2022
@pingbird pingbird deleted the pixeltoast/shapes-and-stuff branch September 23, 2022 01:59
@pingbird pingbird restored the pixeltoast/shapes-and-stuff branch September 23, 2022 02:00
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

Successfully merging this pull request may close these issues.

2 participants