Record Class GuideBook.Colors

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.GuideBook.Colors
Record Components:
light - page colours by name, over the light (and handheld) palette
dark - page colours by name, over a screen book's dark palette
tooltip - tooltip colours by name: background, frame, title, detail
Enclosing class:
GuideBook

public static record GuideBook.Colors(Map<String,Integer> light, Map<String,Integer> dark, Map<String,Integer> tooltip) extends Record
A book's colour scheme: "colors" in book.json, each colour "#RRGGBB" (or "#AARRGGBB").

 "colors": {
   "paper": "#F1E7D0", "text": "#3B3026", "muted": "#8B7B66", "heading": "#2E241B",
   "link": "#5A3A8A", "panel": "#E6D8BA", "line": "#C4B08C",        // the page, in light mode (and a handheld book)
   "dark": {"paper": "#1F222C", "text": "#D5D8E2"},                // the same for a screen book's dark mode
   "tooltip": {"background": "#281E18", "frame": "#FFE28C", "title": "#F2E6CC", "detail": "#A89A86"}
 }
 
Any colour left out keeps the style's own; the marks and rules are "accent". A tooltip left as it is takes on the book: its background from the cover, its frame gilt warmed by the accent.
  • Field Details

  • Constructor Details

  • Method Details

    • over

      public GuidePalette over(GuidePalette palette, boolean darkMode)
      A palette with this scheme's colours for it laid over it.
    • 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 Objects::equals(Object,Object).
      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.
    • light

      public Map<String,Integer> light()
      Returns the value of the light record component.
      Returns:
      the value of the light record component
    • dark

      public Map<String,Integer> dark()
      Returns the value of the dark record component.
      Returns:
      the value of the dark record component
    • tooltip

      public Map<String,Integer> tooltip()
      Returns the value of the tooltip record component.
      Returns:
      the value of the tooltip record component