This commit is contained in:
2023-08-19 06:33:56 +10:00
parent a6d6277070
commit 745476a7a0
6 changed files with 33 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import ktx.math.times
import ktx.math.unaryMinus
import org.hsluv.HUSLColorConverter
import kotlin.math.pow
import kotlin.random.Random
fun Float.axisDeadzone(min: Float, max: Float): Float
{
@ -72,3 +73,5 @@ fun Color.mix(rhs: Color, x: Float) = Color(
//FIXME: find some way to get rid of these warnings
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "UNCHECKED_CAST")
fun <T: Attribute> Attributes.get(type: Long) = get(type) as? T
fun Random.nextFloat(min: Float, max: Float) = min + nextFloat() * (max - min)