updateColorProfileLevel method

void updateColorProfileLevel({
  1. String? newColorProfileLevelName,
})

Moves to the next color profile or the newColorProfileLevelName if it is provided.

If it reaches the end, it starts again from the beginning.

Implementation

void updateColorProfileLevel({
  String? newColorProfileLevelName,
}) {
  final nextColorProfileLevel = newColorProfileLevelName != null
      ? ColorProfileLevel.fromString(newColorProfileLevelName)
      : ColorProfile
          .values[(colorSettings.value.colorProfileLevel.index + 1) %
              ColorProfile.values.length]
          .level;
  colorSettings.value = colorSettings.value.copyWith(
    colorProfileLevel: nextColorProfileLevel,
  );
}