Record Class FoliosPalette

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.page.FoliosPalette
Record Components:
paper - the page itself
text - body text
muted - captions, hints and other quiet text
heading - titles and headings
accent - the book's colour: marks, rules, the bar of a quote
link - links in text
panel - boxes set on the page (a recipe's grid, an image's frame)
line - hairlines: borders and dividers

public record FoliosPalette(int paper, int text, int muted, int heading, int accent, int link, int panel, int line) extends Record
The colours a page is drawn in (ARGB). Pages never pick their own: the same page is ink on paper in a handheld book and light text on a dark panel on a screen, so they draw with these.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FoliosPalette(int paper, int text, int muted, int heading, int accent, int link, int panel, int line)
    Creates an instance of a FoliosPalette record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the accent record component.
    static int
    alpha(int color, int alpha)
    color with its alpha set (0 to 255).
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the heading record component.
    int
    Returns the value of the line record component.
    int
    Returns the value of the link record component.
    static int
    mix(int from, int to, float t)
    One colour a share t (0 to 1) of the way to another, alpha included.
    int
    Returns the value of the muted record component.
    int
    Returns the value of the panel record component.
    int
    Returns the value of the paper record component.
    int
    Returns the value of the text record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FoliosPalette

      public FoliosPalette(int paper, int text, int muted, int heading, int accent, int link, int panel, int line)
      Creates an instance of a FoliosPalette record class.
      Parameters:
      paper - the value for the paper record component
      text - the value for the text record component
      muted - the value for the muted record component
      heading - the value for the heading record component
      accent - the value for the accent record component
      link - the value for the link record component
      panel - the value for the panel record component
      line - the value for the line record component
  • Method Details

    • alpha

      public static int alpha(int color, int alpha)
      color with its alpha set (0 to 255).
    • mix

      public static int mix(int from, int to, float t)
      One colour a share t (0 to 1) of the way to another, alpha included.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • paper

      public int paper()
      Returns the value of the paper record component.
      Returns:
      the value of the paper record component
    • text

      public int text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • muted

      public int muted()
      Returns the value of the muted record component.
      Returns:
      the value of the muted record component
    • heading

      public int heading()
      Returns the value of the heading record component.
      Returns:
      the value of the heading record component
    • accent

      public int accent()
      Returns the value of the accent record component.
      Returns:
      the value of the accent record component
    • link

      public int link()
      Returns the value of the link record component.
      Returns:
      the value of the link record component
    • panel

      public int panel()
      Returns the value of the panel record component.
      Returns:
      the value of the panel record component
    • line

      public int line()
      Returns the value of the line record component.
      Returns:
      the value of the line record component