Click or drag to resize

JobsUtilitiesTryAddValuesFromColor Method

Add the values of r, g, b, a from a Color to a NativeArray.

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static bool TryAddValuesFromColor(
	this NativeArray<float> nativeArray,
	Color colorToAdd,
	int indexForAdd = 0
)

Parameters

nativeArray
Type: NativeArraySingle
The NativeArray to add the values to.
colorToAdd
Type: Color
The Color whose values will be added to the NativeArray.
indexForAdd (Optional)
Type: SystemInt32
Optional parameter to designate where to start adding the values. Defaults to 0.

Return Value

Type: Boolean
True if the values are added successfully, false otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type NativeArraySingle. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also