Hullaballoonatic
01/27/2020, 12:39 AMjava.scene.paint.color
is really annoying to work with. it'd be nice if you could do things like:
val myColor = Color(0.5, 0.5, 0.5)
myColor.saturation += 0.5
myColor.opacity *= 0.3
etc, but nope!altavir
01/27/2020, 5:17 AMHullaballoonatic
02/01/2020, 5:15 PMHullaballoonatic
02/01/2020, 5:29 PMfun Color.hued(shift: Double) = deriveColor(shift, 1.0, 1.0, 1.0)
fun Color.saturated(scalar: Double) = deriveColor(0.0, scalar, 1.0, 1.0)
fun Color.brightened(scalar: Double) = deriveColor(0.0, 1.0, scalar, 1.0)
fun Color.reddened(scalar: Double) = Color(scalar * red, green, blue, opacity)
fun Color.greened(scalar: Double) = Color(red, scalar * green, blue, opacity)
fun Color.blued(scalar: Double) = Color(red, green, scalar * blue, opacity)
fun Color.opaqued(scalar: Double) = Color(red, green, blue, scalar * opacity)
Hullaballoonatic
02/01/2020, 5:34 PMfill
color, but it's of type Paint
, which doesn't have any of those values.Hullaballoonatic
02/01/2020, 5:34 PM