Swatch

class Swatch(val rgb: Int, val population: Int)

Represents a color swatch generated from an image's palette. The RGB color can be retrieved by calling rgb.

Constructors

Link copied to clipboard
constructor(rgb: Int, population: Int)

Properties

Link copied to clipboard

Returns an appropriate color to use for any 'body' text which is displayed over this Swatch's color. This color is guaranteed to have sufficient contrast.

Link copied to clipboard

Return this swatch's HSL values. hsv0 is Hue [0 .. 360) hsv1 is Saturation 0...1 hsv2 is Lightness 0...1

Link copied to clipboard
Link copied to clipboard
val rgb: Int
Link copied to clipboard

Returns an appropriate color to use for any 'title' text which is displayed over this Swatch's color. This color is guaranteed to have sufficient contrast.