AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
Color32Extensions.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 
6 namespace HoloToolkit.Unity
7 {
11  public static class Color32Extensions
12  {
13  public static Color PremultiplyAlpha(Color col)
14  {
15  col.r *= col.a;
16  col.g *= col.a;
17  col.b *= col.a;
18 
19  return col;
20  }
21 
22  public static Color32 PremultiplyAlpha(Color32 col)
23  {
24  Color floatCol = col;
25  return (Color32)PremultiplyAlpha(floatCol);
26  }
27  }
28 }
static Color32 PremultiplyAlpha(Color32 col)
Extension methods for Unity's Color32 class
static Color PremultiplyAlpha(Color col)