INNER CODE UNIT · Kotlin

applyTheme

fjossinet/RNArtist · src/main/kotlin/RNArtist.kt:1272

                    override fun applyTheme(theme: Theme) {
                        mediator.currentDrawing.get()?.secondaryStructureDrawing?.applyTheme(theme)
                        mediator.canvas2D.repaint()
                        mediator.currentDrawing.get()?.let { currentDrawing ->
                            val step = currentDrawing.rnArtistEl.getThemeOrNew().lastStep + 1
                            theme.configurations.forEach { configuration ->

                                when (configuration.propertyName) {
                                    ThemeProperty.color.toString() -> {
                                        configuration.themedElements?.first()?.getColor()
                                            ?.let { color -> //we extract the color to save in the script from the first element stored during the theming process
                                                setColorForFull2D(
                                                    currentDrawing.rnArtistEl,
                                                    fontButton.isClicked,
                                                    color,
                                                    step
                                                )
                                            }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…