divisor method

double divisor(
  1. int depth
)

Returns a value by which interger division may be acceptable; that is, a relatively small scalar like 1.0 or 2.0 or the passed depth itself as a neutralizing divisor.

Implementation

double divisor(int depth) {
  switch (this) {
    case Swell.superdeboss:
      // Has [Neu.linearGradient] darken its `color.withBlack(depth ~/ 1.0)`
      // which provides a darker, inset-appearing color:
      return 1.0;
    case Swell.deboss:
      // Has [Neu.linearGradient] shade its `color.withBlack(depth ~/ 2.0)`
      // so its darkened by a value corresponding to `depth` but at half the
      // strength of `Swell.superdeboss`:
      return 2.0;
    case Swell.emboss:
      // Will actually result in the resultant color of `color.withBlack()`
      // in [Neu.linearGradient] being shaded by `(depth / depth) - 1`,
      // resulting in the color itself. This is the self-neutralizing
      // (and [Neu]-default) choice.
      return depth.toDouble();
    case Swell.superemboss:
      // Will actually brighten the color as a negative parameter to
      // `color.withBlack()` in [Neu.linearGradient] as `depth / -2.5`.
      return -2.5;
  }
}