DiscordColor.fromRgb constructor

const DiscordColor.fromRgb(
  1. int r,
  2. int g,
  3. int b
)

Create a DiscordColor from r, g and b channels ranging from 0 to 255 combined.

r, g and b must be positive and less than 256.

Implementation

const DiscordColor.fromRgb(int r, int g, int b)
    : assert(r >= 0 && r < 256, 'r must be between 0 and 255'),
      assert(g >= 0 && g < 256, 'g must be between 0 and 255'),
      assert(b >= 0 && b < 256, 'b must be between 0 and 255'),
      value = r << 16 | g << 8 | b;