case class RGBColor(red: Int, green: Int, blue: Int, alpha: Int = 255) extends DigitalColor[RGBChannel, Int, RGBColor] with Product with Serializable

Represents an RGB color with red, green, and blue components.

red

the intensity of the red channel (0–255)

green

the intensity of the green channel (0–255)

blue

the intensity of the blue channel (0–255)

Linear Supertypes
Serializable, Product, Equals, DigitalColor[RGBChannel, Int, RGBColor], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RGBColor
  2. Serializable
  3. Product
  4. Equals
  5. DigitalColor
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new RGBColor(red: Int, green: Int, blue: Int, alpha: Int = 255)

    red

    the intensity of the red channel (0–255)

    green

    the intensity of the green channel (0–255)

    blue

    the intensity of the blue channel (0–255)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val alpha: Int
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val blue: Int
  7. def clamp(value: Int): Int

    Clamps a color channel value to the valid range [0, 255].

    Clamps a color channel value to the valid range [0, 255]. Values below 0 are set to 0, and values above 255 are set to 255.

    Attributes
    protected
    Definition Classes
    RGBColorDigitalColor
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  9. def color: Color

    Converts this RGBColor instance into a java.awt.Color object.

    Converts this RGBColor instance into a java.awt.Color object.

    returns

    a Color object representing this RGB color

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  12. val green: Int
  13. def increaseAll(deltaR: Int, deltaG: Int, deltaB: Int, deltaA: Int = 0): RGBColor

    Increases or decreases all color channels simultaneously by different

    Increases or decreases all color channels simultaneously by different

    amounts. Each channel is clamped to stay within [0, 255].

    deltaR

    the amount to add to the red channel

    deltaG

    the amount to add to the green channel

    deltaB

    the amount to add to the blue channel

    returns

    a new RGBColor with adjusted channels

  14. def increaseChannel(channel: RGBChannel, delta: Int)(implicit numeric: Numeric[Int]): RGBColor

    Increase a channel by an amount

    Increase a channel by an amount

    Definition Classes
    DigitalColor
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def mixWith(other: RGBColor, ratio: Double): RGBColor

    Blends this color with another color based on the given ratio.

    Blends this color with another color based on the given ratio. A ratio of 0.0 returns this color; a ratio of 1.0 returns the other color.

    other

    the other color to mix with

    ratio

    the blend ratio between 0.0 and 1.0

    returns

    a new RGBColor representing the blended color

    Exceptions thrown

    IllegalArgumentException if the ratio is outside [0.0, 1.0]

  17. def modifyChannel(channel: RGBChannel)(f: (Int) => Int): RGBColor

    Increases or decreases a specific color channel (Red, Green, or Blue) by the given amount, ensuring the resulting value stays within [0, 255].

    Increases or decreases a specific color channel (Red, Green, or Blue) by the given amount, ensuring the resulting value stays within [0, 255].

    channel

    the color channel to modify

    f

    transformation function for the amount to add (can be negative)

    returns

    a new RGBColor with the modified channel

    Definition Classes
    RGBColorDigitalColor
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. def productElementNames: Iterator[String]
    Definition Classes
    Product
  22. val red: Int
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toHex: String

    Returns the hexadecimal string representation of this color, typically used in web development (e.g., "#ff00cc").

    Returns the hexadecimal string representation of this color, typically used in web development (e.g., "#ff00cc").

    returns

    a lowercase hexadecimal color string

  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from DigitalColor[RGBChannel, Int, RGBColor]

Inherited from AnyRef

Inherited from Any

Ungrouped