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!


Libraries

pixel_color_image