LinearGradient

smile.colors.LinearGradient
See theLinearGradient companion object
case class LinearGradient(start: Pos, end: Pos, fractions: Seq[Float], colors: Seq[Color], cycleMethod: CycleMethod) extends Paint

Represents a linear gradient paint with two or more colors. The start and end points are specified in the local coordinate space of the shape.

Value parameters

colors

A sequence of Color objects corresponding to each fraction in the gradient.

cycleMethod

The method used to repeat the gradient pattern if the shape to be filled is larger than the gradient defined by the start and end points.

end

The ending position of the gradient.

fractions

A sequence of float values in the range [0.0f, 1.0f] indicating the fractional distances along the gradient at which color changes occur.

start

The starting position of the gradient.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Paint
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(start: Pos, end: Pos, startColor: Color, endColor: Color, cycleMethod: CycleMethod)

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy val averageColor: Color

Calculates the average color of the gradient.

Calculates the average color of the gradient.

The average color is calculated by averaging the RGB and opacity values of all colors defined in the gradient.

Attributes

Returns

The average Color of the gradient.