PhysicalConnectivity/src/test/kotlin/net/shadowfacts/cacao/util/ColorTest.kt

25 lines
460 B
Kotlin

package net.shadowfacts.cacao.util
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
/**
* @author shadowfacts
*/
class ColorTest {
@Test
fun fromRGB() {
val color = Color(0x123456)
assertEquals(0x12, color.red)
assertEquals(0x34, color.green)
assertEquals(0x56, color.blue)
}
@Test
fun toARGB() {
val color = Color(red = 0x12, green = 0x34, blue = 0x56, alpha = 0x78)
assertEquals(0x78123456, color.argb)
}
}