FooStudio/tinycolor

Tint and Shade functions ignore the amount parameter

Johann13 opened this issue · 3 comments

The functions to create a tint or shade for a color have a paramater amount.

Currenly this is the library code

TinyColor tint([int amount = 10]) {
  return this.mix(input: Color.fromRGBO(255, 255, 255, 1.0));
}

TinyColor shade([int amount = 10]) {
  return this.mix(input: Color.fromRGBO(0, 0, 0, 1.0));
}

I'm having the same issue. When using the shade function the result is always pure black. I hope this gets fixed soon. Cheers!

I found that too!! That's an easy fix I think!!

Easy workaround for tint, you can do: Color.alphaBlend(Colors.white.withOpacity(amount / 100), color); and for shade: Color.alphaBlend(Colors.black.withOpacity(amount / 100), color);. Works like a charm.