compareColor method

int compareColor(
  1. dynamic other
)

Compares this color to another color.

Implementation

int compareColor(dynamic other) {
  if (other is int) {
    return argb.compareTo(other);
  } else if (other is Color) {
    return argb.compareTo(other.argb);
  } else if (other is String) {
    return argb.compareTo(other.asColor.argb);
  } else if (other is HSLColor) {
    return other.toColor().argb.compareTo(argb);
  } else if (other is HSVColor) {
    return other.toColor().argb.compareTo(argb);
  } else {
    throw ArgumentError('Cannot compare $Color with ${other.runtimeType}');
  }
}