Former-commit-id: 7821931c73c0d90a883b3732eb5a950c2b2a0402
Former-commit-id: b77ed6d9cc3effd183646a7e0c8411b4e125cfd2
This commit is contained in:
Song Minjae
2016-10-24 13:36:09 +09:00
parent 0837d23cb6
commit c65b17deec
7 changed files with 209 additions and 21 deletions

View File

@@ -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