generateThemeByColor static method

UpThemeData generateThemeByColor({
  1. required Color primaryColor,
  2. required Color baseColor,
  3. bool isDark = false,
  4. Color? secondaryColor,
  5. Color? tertiaryColor,
  6. Color? warnColor,
  7. Color? linkColor,
  8. Color? successColor,
})

Implementation

static UpThemeData generateThemeByColor({
  required Color primaryColor,
  required Color baseColor,
  bool isDark = false,
  Color? secondaryColor,
  Color? tertiaryColor,
  Color? warnColor,
  Color? linkColor,
  Color? successColor,
}) {
  return generateThemeByMaterial(
    isDark: isDark ? true : false,
    baseColor: isDark
        ? generateLighterMaterialColor(baseColor)
        : generateDarkerMaterialColor(baseColor),
    primaryColor: generateMaterialFromSingleColor(primaryColor),
    secondaryColor: secondaryColor != null
        ? generateMaterialFromSingleColor(secondaryColor)
        : null,
    tertiaryColor: tertiaryColor != null
        ? generateMaterialFromSingleColor(tertiaryColor)
        : null,
    warnColor:
        warnColor != null ? generateMaterialFromSingleColor(warnColor) : null,
    linkColor:
        linkColor != null ? generateMaterialFromSingleColor(linkColor) : null,
    successColor: successColor != null
        ? generateMaterialFromSingleColor(successColor)
        : null,
  );
}