percentageSize method
Calculates the size based on a percentage of the total size.
Example:
double result = sizeConfig.percentageSize(totalSize, percentageSize);
Implementation
double percentageSize(double totalSize, double percentageSize) {
if (percentageSize > 100) return totalSize;
if (percentageSize < 0) return 0;
return totalSize * (percentageSize / 100);
}