darkerUnsafe static method

double darkerUnsafe(
  1. double tone,
  2. double ratio
)

Tone <= tone parameter that ensures ratio. 0 if ratio cannot be achieved.

This method is unsafe because the returned value is guaranteed to be in bounds, but, the in bounds return value may not reach the desired ratio.

Implementation

static double darkerUnsafe(double tone, double ratio) =>
    darker(tone, ratio) ?? 0.0;