Skip to main content

ChannelPackColors

TextureUtilities.ChannelPackColors()

public static Color[] ChannelPackColors(
float[] valuesR,
float[] valuesG,
float[] valuesB,
float[] valuesA
)
ParameterTypeDefaultDescription
valuesRfloat[]Red values
valuesGfloat[]Green values
valuesBfloat[]Blue values
valuesAfloat[]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;
}
}