int brightness(Color c) { return math .sqrt(c.red * c.red * .241 + c.green * c.green * .691 + c.blue * c.blue * .068) .toInt(); }