Interface IDocThemes

For managing themes.

interface IDocThemes {
    getDefaultTheme: (() => IDocTheme);
    setDefaultTheme: ((theme) => IDocTheme);
    deleteCustomTheme(theme): IDocTheme;
    fromJSON(json): void;
    getTheme(name): IDocTheme;
    getThemes(type?): Map<string, IDocTheme>;
    setCustomTheme(theme): IDocTheme;
    toJSON(): Partial<{
        colorScheme: string | ColorSchemeValues | Partial<{
            accent1: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent2: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent3: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent4: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent5: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent6: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            dk1: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            dk2: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            folHlink: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            hlink: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            lt1: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            lt2: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            name: string;
        }>;
        fontScheme: string | FontSchemeValues | Partial<{
            majorFont: string;
            minorFont: string;
            name: string;
        }>;
        name: string;
    }>[];
}

Hierarchy (view full)

Implemented by

Properties

getDefaultTheme: (() => IDocTheme)

Returns the name of the default Theme.

Type declaration

Returns

setDefaultTheme: ((theme) => IDocTheme)

Set the new default theme.

Type declaration

Returns

'the previous default theme'

Methods

  • This will remove a custom theme.

    Parameters

    Returns IDocTheme

    true if the Theme was removed.

  • Load internal state from json

    Parameters

    • json: Partial<{
          colorScheme: string | ColorSchemeValues | Partial<{
              accent1: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              accent2: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              accent3: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              accent4: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              accent5: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              accent6: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              dk1: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              dk2: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              folHlink: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              hlink: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              lt1: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              lt2: string | AdjustedColor | Partial<{
                  val: string;
                  adjustments: any;
                  asCSS: any;
                  isEqual: any;
                  isImmutable: any;
                  toHSLA: any;
                  toHex: any;
                  toJSON: any;
                  toRGBA: any;
                  toString: any;
              }>;
              name: string;
          }>;
          fontScheme: string | FontSchemeValues | Partial<{
              majorFont: string;
              minorFont: string;
              name: string;
          }>;
          name: string;
      }>[]

    Returns void

  • Return the theme for the given name.

    Parameters

    • name: string

    Returns IDocTheme

    Remarks

    Will try to return:

    1. The custom theme for the name
    2. The builtin theme for the name.
    3. nul if it doesn't exist.
  • Returns new map of all themes.

    Parameters

    Returns Map<string, IDocTheme>

    Default Value

    GetThemeType.All
    

    Remarks

    Generates a new map so this can be mutated without affecting the internal state.

  • This will add or update a theme.

    Parameters

    Returns IDocTheme

    the original theme

    Remarks

    Case insensitive; for duplicate detection purposes.

  • creates a persistable version of Themes

    Returns Partial<{
        colorScheme: string | ColorSchemeValues | Partial<{
            accent1: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent2: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent3: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent4: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent5: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            accent6: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            dk1: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            dk2: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            folHlink: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            hlink: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            lt1: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            lt2: string | AdjustedColor | Partial<{
                val: string;
                adjustments: any;
                asCSS: any;
                isEqual: any;
                isImmutable: any;
                toHSLA: any;
                toHex: any;
                toJSON: any;
                toRGBA: any;
                toString: any;
            }>;
            name: string;
        }>;
        fontScheme: string | FontSchemeValues | Partial<{
            majorFont: string;
            minorFont: string;
            name: string;
        }>;
        name: string;
    }>[]