MakeSolidColorTextureRGBA function

Texture MakeSolidColorTextureRGBA(
  1. ChronosGL cgl,
  2. String url,
  3. Vector4 rgba
)

Implementation

Texture MakeSolidColorTextureRGBA(ChronosGL cgl, String url, VM.Vector4 rgba) {
  int r = (255.0 * rgba.r).round();
  int g = (255.0 * rgba.g).round();
  int b = (255.0 * rgba.b).round();
  return ImageTexture(
      cgl, url, MakeSolidColorCanvas("rgba($r, $g, $b, ${rgba.a})"));
}