TileColor

interface TileColor : Cacheable

A TileColor represents the colors of a Tile. TileColors support transparency through alpha. You can choose to create your own colors using the various factory functions in TileColor.Companion or use ANSITileColor instead that comes with the default ANSI colors.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

darkenByPercent
Link copied to clipboard
common
abstract fun darkenByPercent(percentage: Double): TileColor
Returns a new TileColor which is darkened by the given percentage.
desaturate
Link copied to clipboard
common
open fun desaturate(): TileColor
Returns a new TileColor which is desturated by the DEFAULT_FACTOR (.7).
abstract fun desaturate(factor: Double): TileColor
Returns a new TileColor which is desaturated by factor.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
interpolateTo
Link copied to clipboard
common
abstract fun interpolateTo(other: TileColor): ColorInterpolator
Creates a new ColorInterpolator with the receiver color as low color and the other color as high color.
invert
Link copied to clipboard
common
abstract fun invert(): TileColor
Returns a new TileColor which is the inversion of this one.
lightenByPercent
Link copied to clipboard
common
abstract fun lightenByPercent(percentage: Double): TileColor
Returns a new TileColor which is lightened by the given percentage.
shade
Link copied to clipboard
common
open fun shade(): TileColor
Returns a new TileColor which is shaded by the DEFAULT_FACTOR (.7).
abstract fun shade(factor: Double): TileColor
Returns a new TileColor which is shaded by factor.
tint
Link copied to clipboard
common
open fun tint(): TileColor
Returns a new TileColor which is tinted by the DEFAULT_FACTOR (.7).
abstract fun tint(factor: Double): TileColor
Returns a new TileColor which is tinted by factor.
tone
Link copied to clipboard
common
open fun tone(): TileColor
Returns a new TileColor which is toned by the DEFAULT_FACTOR (.7).
abstract fun tone(factor: Double): TileColor
Returns a new TileColor which is toned by factor.
toString
Link copied to clipboard
common
open fun toString(): String
withAlpha
Link copied to clipboard
common
abstract fun withAlpha(alpha: Int): TileColor
Creates a copy of this TileColor with the given alpha.
withBlue
Link copied to clipboard
common
abstract fun withBlue(blue: Int): TileColor
Creates a copy of this TileColor with the given blue.
withGreen
Link copied to clipboard
common
abstract fun withGreen(green: Int): TileColor
Creates a copy of this TileColor with the given green.
withRed
Link copied to clipboard
common
abstract fun withRed(red: Int): TileColor
Creates a copy of this TileColor with the given red.

Properties

alpha
Link copied to clipboard
common
abstract val alpha: Int
blue
Link copied to clipboard
common
abstract val blue: Int
cacheKey
Link copied to clipboard
common
abstract val cacheKey: String
A unique and immutable cache key for this object.
green
Link copied to clipboard
common
abstract val green: Int
isOpaque
Link copied to clipboard
common
open val isOpaque: Boolean
red
Link copied to clipboard
common
abstract val red: Int

Inheritors

ANSITileColor
Link copied to clipboard

Extensions

toAWTColor
Link copied to clipboard
fun TileColor.toAWTColor(): Color
Extension for easy conversion between TileColor and awt Color.

Sources

(source)
Link copied to clipboard