From 447da939b0f9ceee90026620d042cf01398cb6d7 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Wed, 2 Mar 2016 16:32:38 -0800 Subject: [PATCH] fix Icon alpha handling --- packages/flutter/lib/src/material/icon.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/lib/src/material/icon.dart b/packages/flutter/lib/src/material/icon.dart index d27572d2d4..95c2b0d0cf 100644 --- a/packages/flutter/lib/src/material/icon.dart +++ b/packages/flutter/lib/src/material/icon.dart @@ -60,10 +60,10 @@ class Icon extends StatelessComponent { if (icon == null) return new SizedBox(width: size, height: size); + final double iconOpacity = IconTheme.of(context)?.clampedOpacity ?? 1.0; Color iconColor = color ?? _getDefaultColor(context); - final int iconAlpha = (255.0 * (IconTheme.of(context)?.clampedOpacity ?? 1.0)).round(); - if (iconAlpha != 255) - iconColor = color.withAlpha((iconAlpha * color.opacity).round()); + if (iconOpacity != 1.0) + iconColor = iconColor.withAlpha((255.0 * iconColor.opacity * iconOpacity).round()); return new ExcludeSemantics( child: new SizedBox(