ChannelPackColors
TextureUtilities.ChannelPackColors()
public static Color[] ChannelPackColors(
float[] valuesR,
float[] valuesG,
float[] valuesB,
float[] valuesA
)
| Parameter | Type | Default | Description |
|---|---|---|---|
| valuesR | float[] | Red values | |
| valuesG | float[] | Green values | |
| valuesB | float[] | Blue values | |
| valuesA | float[] | Alpha values |
Returns: The Channel Packed array of Colors. Returns null if this fails
Channel Pack 4 arrays of floats of the same length into a single array of RGBA colors. Used to make Channel Packed Textures.
Example Usage
using UnityEngine;
using MikeDaBird.EZRecolor.Utilities;
class RotateTexture : MonoBehavior{
public Color colorRed;
public Color colorGreen;
public Color colorBlue;
public Color colorAlpha;
// Rotate a texture by a rotation, both set within the Component
public Texture2D DoARotation(){
texture = TextureUtilities.Rotate(texture, rotation);
return texture;
}
}