Answers for "colorfiltered flutter black white"

0

colorfiltered flutter black white

# Method 1:
ColorFiltered(
	ColorFilter.mode(
     Colors.grey,
     BlendMode.saturation,
   ),
   child: ...
Source 1: https://medium.com/@samarth_agarwal/turn-images-to-grayscale-in-flutter-the-colorfiltered-widget-16de44cf8045
   
# Method 2:
const ColorFilter greyscale = ColorFilter.matrix(<double>[
  0.2126, 0.7152, 0.0722, 0, 0,
  0.2126, 0.7152, 0.0722, 0, 0,
  0.2126, 0.7152, 0.0722, 0, 0,
  0,      0,      0,      1, 0,
]);

ColorFiltered(
  colorFilter: greyscale,
  child: ....,
);

Source 2: https://stackoverflow.com/questions/47851690/making-an-image-widget-disabled-grayed-out
Posted by: Guest on August-07-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language