adjust materials
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package gay.pizza.CavesOfJolk
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.math.MathUtils
|
||||
import com.badlogic.gdx.math.Vector2
|
||||
import ktx.math.div
|
||||
import ktx.math.times
|
||||
@ -51,3 +52,9 @@ fun Color.lighten(ld: Double): Color
|
||||
val rgb = HUSLColorConverter.hsluvToRgb(hsl)
|
||||
return Color(rgb[0].toFloat(), rgb[1].toFloat(), rgb[2].toFloat(), a)
|
||||
}
|
||||
|
||||
fun Color.mix(rhs: Color, x: Float) = Color(
|
||||
MathUtils.lerp(this.r, rhs.r, x),
|
||||
MathUtils.lerp(this.g, rhs.g, x),
|
||||
MathUtils.lerp(this.b, rhs.b, x),
|
||||
MathUtils.lerp(this.a, rhs.a, x))
|
||||
|
Reference in New Issue
Block a user