Define gray method explicitly, use a positive check for alpha value