I needs to find a better approach to generate shade colors from a given custom color for theming purposes. So far I found a way to do this by reducing opacity of the given color as below. so I can accent Color color and faded color of given color to this function.
import 'package:flutter/material.dart';
class AppColors {
Color accentColor;
Color fadedColor;
AppColors(this.accentColor, this.fadedColor);
}
AppColors getAppColors(String color) {
int budgetAccentcolor = int.parse('0xff' + color);
int budgetFadedColor = int.parse('0x26' + color);
return AppColors(Color(budgetAccentcolor), Color(budgetFadedColor));
}
But because of I'm reducing opacity of the color It shows what's going under the widgets like when using SliverAppBar.
Is there anyway to get the faded value of a Hex color?