Package com.onec.ui

Record Class BrandPalette

java.lang.Object
java.lang.Record
com.onec.ui.BrandPalette
Record Components:
page - the app background behind the islands
surface - card / panel fill
border - hairline strokes and separators
text - primary foreground
muted - secondary / caption foreground
primary - brand accent (active nav, links, primary buttons)
primarySoft - the tint painted behind the active/selected accent

public record BrandPalette(String page, String surface, String border, String text, String muted, String primary, String primarySoft) extends Record
A consumer's brand color overrides for one mode (light or dark). Every field is nullable: a null keeps the renderer's default for that slot, so an app can override just primary and inherit the rest of the neutral scale. The renderer (onec-ui-starter's Palette) merges a non-null value over its built-in LIGHT/DARK constant, which is how the DivKit chrome picks up brand colors.

The slots mirror the ones the issue calls out as the brandable minimum plus the two that visibly carry the brand accent — primary (active/selected) and primarySoft (its tint behind the active item).

  • Constructor Details

    • BrandPalette

      public BrandPalette(String page, String surface, String border, String text, String muted, String primary, String primarySoft)
      Creates an instance of a BrandPalette record class.
      Parameters:
      page - the value for the page record component
      surface - the value for the surface record component
      border - the value for the border record component
      text - the value for the text record component
      muted - the value for the muted record component
      primary - the value for the primary record component
      primarySoft - the value for the primarySoft record component
  • Method Details

    • empty

      public static BrandPalette empty()
      No overrides — every slot keeps the renderer default.
    • isEmpty

      public boolean isEmpty()
      True when nothing is overridden, so the renderer can skip merging entirely.
    • 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.
    • page

      public String page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • surface

      public String surface()
      Returns the value of the surface record component.
      Returns:
      the value of the surface record component
    • border

      public String border()
      Returns the value of the border record component.
      Returns:
      the value of the border record component
    • text

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

      public String muted()
      Returns the value of the muted record component.
      Returns:
      the value of the muted record component
    • primary

      public String primary()
      Returns the value of the primary record component.
      Returns:
      the value of the primary record component
    • primarySoft

      public String primarySoft()
      Returns the value of the primarySoft record component.
      Returns:
      the value of the primarySoft record component