mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
AI API
Former-commit-id: 7821931c73c0d90a883b3732eb5a950c2b2a0402 Former-commit-id: b77ed6d9cc3effd183646a7e0c8411b4e125cfd2
This commit is contained in:
@@ -5,6 +5,8 @@ import org.newdawn.slick.Color
|
||||
import net.torvald.colourutil.CIELabUtil.toXYZ
|
||||
import net.torvald.colourutil.CIELabUtil.toRawRGB
|
||||
import net.torvald.colourutil.CIELabUtil.toRGB
|
||||
import net.torvald.colourutil.CIELuvUtil.toLuv
|
||||
import net.torvald.colourutil.CIELuvUtil.toXYZ
|
||||
|
||||
/**
|
||||
* A modification of CIEXYZ that is useful for additive mixtures of lights.
|
||||
@@ -91,14 +93,14 @@ object CIELuvUtil {
|
||||
return CIEXYZ(X, Y, Z, alpha)
|
||||
}
|
||||
|
||||
fun Color.toLuv() = this.toXYZ().toLuv()
|
||||
fun CIELuv.toRawRGB() = this.toXYZ().toRawRGB()
|
||||
fun CIELuv.toRGB() = this.toXYZ().toRGB()
|
||||
|
||||
private fun Float.cbrt() = FastMath.pow(this, 1f / 3f)
|
||||
private fun Float.cube() = this * this * this
|
||||
}
|
||||
|
||||
fun Color.toLuv() = this.toXYZ().toLuv()
|
||||
fun CIELuv.toRawRGB() = this.toXYZ().toRawRGB()
|
||||
fun CIELuv.toRGB() = this.toXYZ().toRGB()
|
||||
|
||||
/**
|
||||
* Range:
|
||||
* L: 0-100.0
|
||||
|
||||
Reference in New Issue
Block a user