Interface Theme

All Known Implementing Classes:
AbstractAtlantaFXTheme, AbstractTheme, NordDarkTheme, NordLightTheme, PrimerDarkTheme, PrimerLightTheme

public interface Theme
Encapsulates a customizable user agent stylesheet.
  • Method Details

    • getName

      @NonNull String getName()
      Gets the name of the theme.
      Returns:
      the name of the theme.
    • createUserAgentStylesheet

      @Nullable String createUserAgentStylesheet(@NonNull ThemeParameters params)
      Generates a user agent stylesheet that can be set on Application.setUserAgentStylesheet(String).

      The stylesheet must be a URL. If the stylesheet is generated dynamically, the stylesheet can be a String that is converted into a Data URL. See toDataUrl(String).

      Parameters:
      params - parameters for generating the stylesheet
      Returns:
      a stylesheet URL
    • getAppearance

      @NonNull String getAppearance()
      Gets the appearance of the theme.

      This is an open-ended set of values. Common values are "light", "dark".

      light
      A light appearance ("day mode") consists of light background colors and dark foreground/text colors.
      dark
      A dark appearance ("night mode") consists of the opposite, with dark background colors and light foreground/text colors.
      Returns:
      the appearance
    • toDataUrl

      static String toDataUrl(String data)
      Converts a String into a data url that contains the String.