general cleanup

This commit is contained in:
downthecrop 2024-10-28 12:43:29 -07:00
parent 52d07d5795
commit 1cca6611ee
8 changed files with 46 additions and 65 deletions

View file

@ -95,10 +95,8 @@ object Helpers {
}
fun convertToColor(value: String): Color {
val color = Color.decode(value) // Assumes value is in format "#RRGGBB" or "0xRRGGBB"
return color
private fun convertToColor(value: String): Color {
return Color.decode(value)
}
fun colorToHex(color: Color): String {
@ -134,11 +132,7 @@ object Helpers {
class FieldNotifier(private val plugin: Any) {
private val observers = mutableListOf<FieldObserver>()
fun addObserver(observer: FieldObserver) {
observers.add(observer)
}
fun notifyFieldChange(field: Field, newValue: Any?) {
private fun notifyFieldChange(field: Field, newValue: Any?) {
for (observer in observers) {
observer.onFieldChange(field, newValue)
}