Interface Colorc

All Known Implementing Classes:
Color

public interface Colorc
An immutable view of a Color. All methods in this interface are pure.
Since:
1.0.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
    default int
     
    default int
     
    float
     
    default int
     
    default Color
    darken(float amount, Color store)
    Mixes this color with black to "darken" it.
    default Color
    Applies a grayscale filter to this color.
    float
     
    default int
     
    default float
    hue()
     
    default Color
    invert(Color store)
    Inverts this color.
    default Color
    lerp(Colorc other, float delta, Color store)
    Linearly interpolates between this color and the specified color.
    default Color
    lighten(float amount, Color store)
    Mixes this color with white to "brighten" it.
    default float
     
    default float
     
    default float
     
    default Color
    mix(Colorc color, float amount, Color store)
    Mixes this color with the specified color.
    float
    red()
     
    default int
     
    default int
    rgb()
     
    default float
     
    default Color
    sepia(Color store)
    Applies a sepia filter to this color.
    default Color
    setHSV(float hue, float saturation, float luminance, Color store)
    Converts the specified hue, saturation, and luminance values (HSV) to RGB.
    default Color
    setHue(float hue, Color store)
    Converts the specified hue value (HSV) to RGB.
    default Color
    setLuminance(float luminance, Color store)
    Converts the specified luminance value (HSV) to RGB.
    default Color
    setSaturation(float saturation, Color store)
    Converts the specified saturation value (HSV) to RGB.
  • Method Details

    • red

      @Contract(pure=true) float red()
      Returns:
      The red component of this color
    • green

      @Contract(pure=true) float green()
      Returns:
      The green component of this color
    • blue

      @Contract(pure=true) float blue()
      Returns:
      The blue component of this color
    • alpha

      @Contract(pure=true) float alpha()
      Returns:
      The alpha component of this color
    • redInt

      @Contract(pure=true) default int redInt()
      Returns:
      The value of red as an int from 0 to 255
    • greenInt

      @Contract(pure=true) default int greenInt()
      Returns:
      The value of green as an int from 0 to 255
    • blueInt

      @Contract(pure=true) default int blueInt()
      Returns:
      The value of blue as an int from 0 to 255
    • alphaInt

      @Contract(pure=true) default int alphaInt()
      Returns:
      The value of alpha as an int from 0 to 255
    • rgb

      @Contract(pure=true) default int rgb()
      Returns:
      This color formatted as an int (RRGGBB)
    • argb

      @Contract(pure=true) default int argb()
      Returns:
      This color formatted as an int (AARRGGBB)
    • minComponent

      @Contract(pure=true) default float minComponent()
      Returns:
      The smallest color component (red, green, or blue)
    • maxComponent

      @Contract(pure=true) default float maxComponent()
      Returns:
      The largest color component (red, green, or blue)
    • hue

      @Contract(pure=true) default float hue()
      Returns:
      The angle in degrees around the color wheel
    • saturation

      @Contract(pure=true) default float saturation()
      Returns:
      The color saturation percentage
    • luminance

      @Contract(pure=true) default float luminance()
      Returns:
      The luminance percentage
    • lerp

      @Contract(pure=true) default Color lerp(Colorc other, float delta, Color store)
      Linearly interpolates between this color and the specified color.
      Parameters:
      other - The other color to store in
      delta - The delta from 0 to 1
      store - The color to store in
      Returns:
      The passed in color
    • mix

      @Contract(pure=true) default Color mix(Colorc color, float amount, Color store)
      Mixes this color with the specified color.
      Parameters:
      color - The color to mix with
      amount - The amount of that color to mix from 0 to 1
      store - The color to store in
      Returns:
      The passed in color
    • lighten

      @Contract(pure=true) default Color lighten(float amount, Color store)
      Mixes this color with white to "brighten" it.
      Parameters:
      amount - The amount of white to add
      store - The color to store in
      Returns:
      The passed in color
    • darken

      @Contract(pure=true) default Color darken(float amount, Color store)
      Mixes this color with black to "darken" it.
      Parameters:
      amount - The amount of black to add
      store - The color to store in
      Returns:
      The passed in color
    • invert

      @Contract(pure=true) default Color invert(Color store)
      Inverts this color.
      Parameters:
      store - The color to store in
      Returns:
      The passed in color
    • grayscale

      @Contract(pure=true) default Color grayscale(Color store)
      Applies a grayscale filter to this color.
      Parameters:
      store - The color to store in
      Returns:
      The passed in color
    • sepia

      @Contract(pure=true) default Color sepia(Color store)
      Applies a sepia filter to this color.
      Parameters:
      store - The color to store in
      Returns:
      The passed in color
    • setHue

      @Contract(pure=true) default Color setHue(float hue, Color store)
      Converts the specified hue value (HSV) to RGB.
      Parameters:
      hue - The hue angle from 0 to 360 degrees
      store - The color to store the result in
      Returns:
      The passed in color
    • setSaturation

      @Contract(pure=true) default Color setSaturation(float saturation, Color store)
      Converts the specified saturation value (HSV) to RGB.
      Parameters:
      saturation - The saturation percentage from 0 to 1
      store - The color to store the result in
      Returns:
      The passed in color
    • setLuminance

      @Contract(pure=true) default Color setLuminance(float luminance, Color store)
      Converts the specified luminance value (HSV) to RGB.
      Parameters:
      luminance - The brightness percentage from 0 to 1
      store - The color to store the result in
      Returns:
      The passed in color
    • setHSV

      @Contract(pure=true) default Color setHSV(float hue, float saturation, float luminance, Color store)
      Converts the specified hue, saturation, and luminance values (HSV) to RGB.
      Parameters:
      hue - The hue angle from 0 to 360 degrees
      saturation - The saturation percentage from 0 to 1
      luminance - The brightness percentage from 0 to 1
      store - The color to store the result in
      Returns:
      The passed in color