|
1 | 1 | package org.openrndr.extra.color.colormaps |
2 | 2 |
|
3 | | -import io.kotest.matchers.shouldBe |
4 | 3 | import org.openrndr.color.ColorRGBa |
5 | 4 | import org.openrndr.color.Linearity |
6 | 5 | import org.openrndr.math.Vector3 |
7 | 6 | import kotlin.test.Test |
| 7 | +import kotlin.test.assertEquals |
8 | 8 |
|
9 | 9 | class TestTurboColormap { |
10 | 10 |
|
11 | 11 | @Test |
12 | 12 | fun testTurboColormapVector() { |
13 | | - turboColormapVector(0.0) shouldBe Vector3(0.13572138, 0.09140261, 0.1066733) |
14 | | - turboColormapVector(0.5) shouldBe Vector3(0.5885220621875007, 0.981864383125, 0.31316869781249856) |
15 | | - turboColormapVector(1.0) shouldBe Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974) |
16 | | - turboColormapVector(-0.1) shouldBe Vector3(0.13572138, 0.09140261, 0.1066733) |
17 | | - turboColormapVector(1.1) shouldBe Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974) |
| 13 | + assertEquals(turboColormapVector(0.0), Vector3(0.13572138, 0.09140261, 0.1066733)) |
| 14 | + assertEquals(turboColormapVector(0.5), Vector3(0.5885220621875007, 0.981864383125, 0.31316869781249856)) |
| 15 | + assertEquals(turboColormapVector(1.0), Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974)) |
| 16 | + assertEquals(turboColormapVector(-0.1), Vector3(0.13572138, 0.09140261, 0.1066733)) |
| 17 | + assertEquals(turboColormapVector(1.1), Vector3(0.5658592099999993, 0.05038885999999998, -0.025520659999997974)) |
18 | 18 | } |
19 | 19 |
|
20 | 20 | @Test |
21 | 21 | fun testTurboColormap() { |
22 | | - turboColormap(0.0) shouldBe ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR) |
23 | | - turboColormap(0.5) shouldBe ColorRGBa(0.5885220621875007, 0.981864383125, 0.31316869781249856, linearity = Linearity.LINEAR) |
24 | | - turboColormap(1.0) shouldBe ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR) |
25 | | - turboColormap(-0.1) shouldBe ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR) |
26 | | - turboColormap(1.1) shouldBe ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR) |
| 22 | + assertEquals(turboColormap(0.0), ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR)) |
| 23 | + assertEquals(turboColormap(0.5), ColorRGBa(0.5885220621875007, 0.981864383125, 0.31316869781249856, linearity = Linearity.LINEAR)) |
| 24 | + assertEquals(turboColormap(1.0), ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR)) |
| 25 | + assertEquals(turboColormap(-0.1), ColorRGBa(0.13572138, 0.09140261, 0.1066733, linearity = Linearity.LINEAR)) |
| 26 | + assertEquals(turboColormap(1.1), ColorRGBa(0.5658592099999993, 0.05038885999999998, -0.025520659999997974, linearity = Linearity.LINEAR)) |
27 | 27 | } |
28 | 28 |
|
29 | 29 | } |
0 commit comments