pixel_color_image 1.2.5 copy "pixel_color_image: ^1.2.5" to clipboard
pixel_color_image: ^1.2.5 copied to clipboard

Pick the pixel color of a image. onHover, onTap, and the Preview widget.

Header

https://pub.dev/packages/pixel_color_image



Usage #

1. Widget #

  • image in assets folder
PixelColor.assetImage(
  path: 'images/xxx.png',
  onHover: onHover,
  onTap: onTap,
);
  • image by URL
PixelColor.networkImage(
  url: 'https://example.com/xxx.png',
  onHover: onHover,
  onTap: onTap,
);

2. functions are called #

/// While Hoverring
void onHover(int x, int y, Color color) async {
  debugPrint('Hover x: $x, y: $y, color: $color');
}

/// When tap
void onTap(int x, int y, Color color) async {
  debugPrint('Tap x: $x, y: $y, color: $color');
}



Color-Preview Widget #

diagram

1. Define ref #

final ref = PixelColorRef();

2. Connect widgets with ref #

// Image
PixelColor.assetImage(
  ...
  ...
  ref: ref,
);

// Color Preview
PixelColorPreview(
  ref: ref,
);

🎉 any issues, requests, contributions are welcomed!


8
likes
140
pub points
60%
popularity

Publisher

verified publisherflut.rbdog.biz

Pick the pixel color of a image. onHover, onTap, and the Preview widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, image

More

Packages that depend on pixel_color_image