ColorSetting

class ColorSetting(name: String, val default: Color, var allowAlpha: Boolean = true, visibility: Visibility = Visibility.VISIBLE, description: String? = null) : Setting<Color>

A color setting for Modules.

Represented by 3 or 4 sliders in the GUI.

Author

Aton

Constructors

Link copied to clipboard
fun ColorSetting(name: String, default: Color, allowAlpha: Boolean = true, visibility: Visibility = Visibility.VISIBLE, description: String? = null)

Types

Link copied to clipboard

Enum to allow for a for loop through the values. This is the best solution I could come up with on the spot to circumvent that I cannot pass a reference to the int values.

Functions

Link copied to clipboard

Returns an array of the availiable settings. Those are either red, green and blue or red, green, blue and alpha.

Link copied to clipboard

Gets the value for the given color.

Link copied to clipboard
open operator override fun getValue(thisRef: Module, property: KProperty<*>): Color

This method acts as the getter for the property delegated to this class.

Link copied to clipboard
open operator override fun provideDelegate(thisRef: Module, property: KProperty<*>): ReadWriteProperty<Module, Color>

This operator provides the Delegate to the Setting.

Link copied to clipboard
open fun reset()

Sets value to default.

Link copied to clipboard
fun setNumber(colorNumber: ColorSetting.ColorComponent, number: Double)

Sets the value for the specified color.

Link copied to clipboard
open operator override fun setValue(thisRef: Module, property: KProperty<*>, value: Color)

This method acts as the setter for the property delegated to this class.

Properties

Link copied to clipboard
var allowAlpha: Boolean = true
Link copied to clipboard
var alpha: Int
Link copied to clipboard
var blue: Int
Link copied to clipboard
Link copied to clipboard
open override val default: Color

The default for value.

Link copied to clipboard
Link copied to clipboard
var green: Int
Link copied to clipboard
var hue: Float
Link copied to clipboard
Link copied to clipboard

Can be set to add a setting specific restraint / extra action when setting the new value.

Link copied to clipboard
var red: Int
Link copied to clipboard
Link copied to clipboard

Returns whether this setting should be visible based on visibilityDependency. Is true by default. Use withDependency to change this behavior.

Link copied to clipboard
open override var value: Color

This is the main field used to store the state of the setting. There can be additional properties for managing the state in the implementations.

Link copied to clipboard