be.doeraene.webcomponents.ui5.scaladsl.colour.RGBColour.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web-components-ui5_sjs1_3 Show documentation
Show all versions of web-components-ui5_sjs1_3 Show documentation
Laminar bindings for the web-component library UI5 from SAP
The newest version!
package be.doeraene.webcomponents.ui5.scaladsl.colour
import scala.language.implicitConversions
import scala.util.Random
final case class RGBColour(red: Int, green: Int, blue: Int) extends Colour {
def alpha: Double = 1
def withAlpha(alpha: Double): RGBAColour = RGBAColour(red, green, blue, alpha)
def withoutAlpha: RGBColour = this
def asRGBAColour: RGBAColour = withAlpha(1.0)
}
object RGBColour {
implicit def asRGBA(rgb: RGBColour): RGBAColour = rgb.withAlpha(1.0)
}