Class IncodeThemeConfig

  • All Implemented Interfaces:

    @Serializable() 
    public final class IncodeThemeConfig
    
                        

    Incode theme configuration used in modules designed using Compose.

    It supports typography IncodeTypography and color scheme IncodeColorScheme customisation, look into concrete classes for more info. Objects has JSON support, so it's possible to serialize content using IncodeThemeConfig.toJson or deserialize it using IncodeThemeConfig.fromJson.

    Example of JSON:

    {
      "typography": {
        "family": {
          "text": {
            "android": {
              "variable": "dm_sans_variable", // if `variable` variant is provided, others keys from same object are ignored
              "regular": "dm_sans_regular",
              "bold": "dm_sans_bold",
              "medium": "dm_sans_medium"
            }
          },
          "display": {
            "android": {
              "regular": "dm_sans_regular",
              "bold": "dm_sans_bold",
              "medium": "dm_sans_medium"
            }
          }
        },
        "letterSpacing": {
          "none": 0,
          "medium": -0.5,
          "large": -1.0,
          "extraLarge": -1.5
        }
      },
      "colorPalette": {
        "brand": "#ff006aff",
        "neutral": "#ffffffff",
        "black": "#ff000000"
        ...
      },
      "displayMode": "LIGHT", // or "DARK" or "SYSTEM"
      "components": {
        "buttons": [
          {
            "style": "primary",
            "surface": {
              "default": ["#000000", "#E8E8E8"],
              "hover": "#04FF5C",
              "pressed": "#00B540",
              "disabled": ["#EBECEF", "#000000"]
            },
            "text": {
              "default": ["#FFFFFF", "#000000"],
              "disabled": ["#959595", "#666666"]
            },
            "border": {
              "color": {
                "default": "#00D149",
                "hover": "#04FF5C",
                "pressed": "#00B540",
                "disabled": "#EBECEF"
              },
              "width": 0,
              "radius": 15
            }
          },
           {
            "style": "secondary",
            "surface": {
              "default": ["#000000", "#E8E8E8"],
              "hover": "#04FF5C",
              "pressed": "#00B540",
              "disabled": ["#EBECEF", "#000000"]
            },
            "text": {
              "default": ["#FFFFFF", "#000000"],
              "disabled": ["#959595", "#666666"]
            },
            "border": {
              "color": {
                "default": "#00D149",
                "hover": "#04FF5C",
                "pressed": "#00B540",
                "disabled": "#EBECEF"
              },
              "width": 2,
              "radius": 15
            }
          }
        ]
      }
    }
    Since:

    5.34.0