Flutter Color.fromARGB

iOS 上对应的RGBA [UIColor colorWithRed: green: blue: alpha: ],RGB 0255 之前的值 A 01之间的值。对应Flutter 的 Color.fromRGBO 。

Flutter 上对应ARGB , Color.fromARGB(a, r, g, b) , 看 a 是 int 型,以为值是0100 之间,对应出的颜色总是偏白,还以为色差,看了api ARGB 都是0255

const Color.fromARGB(
int a,
int r,
int g,
int b
)

Construct a color from the lower 8 bits of four integers.

  • a is the alpha value, with 0 being transparent and 255 being fully opaque.
  • r is red, from 0 to 255.
  • g is green, from 0 to 255.
  • b is blue, from 0 to 255.

Out of range values are brought into range using modulo 255.

https://api.flutter.dev/flutter/dart-ui/Color/Color.fromARGB.html