Spectral Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 9

DownloadSpectral Manual
Open PDF In BrowserView PDF
Spectral
Manual – Spectral for Unity
Version 1.0.1

Created by Jonathan Potts
Support Email: jonathanpotts@outlook.com

Contents
Setup Guide ................................................................................................................................................ 3
Example Script ........................................................................................................................................ 3
Script Reference.......................................................................................................................................... 4
Led Class ................................................................................................................................................. 4
CorsairIsEnabled() ............................................................................................................................... 4
Initialize() ............................................................................................................................................ 4
LogitechIsEnabled() ............................................................................................................................. 4
RazerIsEnabled() ................................................................................................................................. 4
SetColor(byte, byte, byte) ................................................................................................................... 5
SetColor(Color) ................................................................................................................................... 5
SetColorForDevice(DeviceType, byte, byte, byte) ............................................................................... 5
SetColorForDevice(DeviceType, Color) ............................................................................................... 6
SetColorForLed(LedName, byte, byte, byte) ....................................................................................... 6
SetColorForLed(LedName, Color)........................................................................................................ 7
SetColorForLeds(List, byte, byte, byte) ............................................................................ 7
SetColorForLeds(List, Color) ............................................................................................. 8
SetColorForLeds(LedName[], byte, byte, byte) ................................................................................... 8
SetColorForLeds(LedName[], Color) .................................................................................................... 9
Shutdown() ......................................................................................................................................... 9

Setup Guide
1. Download Spectral from the Unity Asset Store and add it to your Unity project.
2. Download the Corsair CUE SDK and add it to your Unity project.
a. The Corsair CUE SDK can be downloaded from:
http://downloads.corsair.com/download?item=Files/CUE/CUESDK_3.0.171.zip
b. The file at CUESDK\redist\x64\CUESDK.x64_2015.dll needs to be copied into the
Spectral\Plugins\x86_64 folder in your Unity project.
c. The file at CUESDK\redist\i386\CUESDK_2015.dll needs to be copied into the
Spectral\Plugins\x86 folder in your Unity project.
3. Implement functionality from Spectral in your project’s scripts.

Example Script
using UnityEngine;
using Spectral;
public class SpectralExample : MonoBehaviour
{
void Start()
{
if (Led.Initialize())
{
Led.SetColor(Color.black);
Led.SetColorForLeds(
new [] { LedName.W, LedName.A, LedName.S, LedName.D },
Color.magenta
);
}
}
void OnDestroy()
{
Led.Shutdown();
}
}

Script Reference
Led Class
Namespace: Spectral
Performs operations for RGB LED Illumination.
public class Led

CorsairIsEnabled()
Checks if Corsair device support was enabled during initialization.
public static bool CorsairIsEnabled();
Returns
bool
True if Corsair device support is enabled.

Initialize()
Manually initialize the Spectral library. If Spectral is not initialized, this method will be called when trying
to perform operations.
public static bool Initialize();
Returns
bool
True if initialization was successful.

LogitechIsEnabled()
Checks if Logitech device support was enabled during initialization.
public static bool LogitechIsEnabled();
Returns
bool
True if Logitech device support is enabled.

RazerIsEnabled()
Checks if Razer device support was enabled during initialization.
public static bool RazerIsEnabled();
Returns
bool
True if Razer device support is enabled.

SetColor(byte, byte, byte)
Sets the color of all LEDs on enabled devices to the specified color.
public static bool SetColor(byte red, byte green, byte blue);
Parameters
red byte
The red channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
green byte
The green channel value for the color to set. On monochromatic devices, only the highest channel value
is used.
blue byte
The blue channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
Returns
bool
True if LEDs on all enabled devices were successfully set.

SetColor(Color)
Sets the color of all LEDs on enabled devices to the specified color.
public static bool SetColor(Color color);
Parameters
color Color
The color to set. On monochromatic devices, only the highest channel value is used.
Returns
bool
True if LEDs on all enabled devices were successfully set.

SetColorForDevice(DeviceType, byte, byte, byte)
Sets the color of all enabled devices of the specified type to the specified color.
public static bool SetColorForDevice(DeviceType deviceType, byte red, byte green, byte blue);
Parameters
deviceType DeviceType
The type of devices to set.
red byte

The red channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
green byte
The green channel value for the color to set. On monochromatic devices, only the highest channel value
is used.
blue byte
The blue channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
Returns
bool
True if LEDs on all enabled devices were successfully set.

SetColorForDevice(DeviceType, Color)
Sets the color of all enabled devices of the specified type to the specified color.
public static bool SetColorForDevice(DeviceType deviceType, Color color);
Parameters
deviceType DeviceType
The type of devices to set.
color Color
The color to set. On monochromatic devices, only the highest channel value is used.
Returns
bool
True if LEDs on all enabled devices were successfully set.

SetColorForLed(LedName, byte, byte, byte)
Sets the color of the specified LED on enabled devices to the specified color.
public static bool SetColorForLed(LedName ledName, byte red, byte green, byte blue);
Parameters
ledName LedName
The LED Name value for the LED to be set.
red byte
The red channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
green byte

The green channel value for the color to set. On monochromatic devices, only the highest channel value
is used.
blue byte
The blue channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
Returns
bool
True if specified LED on any enabled device was successfully set.

SetColorForLed(LedName, Color)
Sets the color of the specified LED on enabled devices to the specified color.
public static bool SetColorForLed(LedName ledName, Color color);
Parameters
ledName LedName
The LED Name value for the LED to be set.
color Color
The color to set. On monochromatic devices, only the highest channel value is used.
Returns
bool
True if specified LED on any enabled device was successfully set.

SetColorForLeds(List, byte, byte, byte)
Sets the color of the specified LEDs on enabled devices to the specified color.
public static bool SetColorForLeds(List ledNames, byte red, byte green, byte blue);
Parameters
ledNames List
The LED Name values for the LEDs to be set.
red byte
The red channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
green byte
The green channel value for the color to set. On monochromatic devices, only the highest channel value
is used.
blue byte

The blue channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
Returns
bool
True if specified LEDs on any enabled device was successfully set.

SetColorForLeds(List, Color)
Sets the color of the specified LEDs on enabled devices to the specified color.
public static bool SetColorForLeds(List ledNames, Color color);
Parameters
ledNames List
The LED Name values for the LEDs to be set.
color Color
The color to set. On monochromatic devices, only the highest channel value is used.
Returns
bool
True if specified LEDs on any enabled device was successfully set.

SetColorForLeds(LedName[], byte, byte, byte)
Sets the color of the specified LEDs on enabled devices to the specified color.
public static bool SetColorForLeds(LedName[] ledNames, byte red, byte green, byte blue);
Parameters
ledNames LedName[]
The LED Name values for the LEDs to be set.
red byte
The red channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
green byte
The green channel value for the color to set. On monochromatic devices, only the highest channel value
is used.
blue byte
The blue channel value for the color to set. On monochromatic devices, only the highest channel value is
used.
Returns
bool

True if specified LEDs on any enabled device was successfully set.

SetColorForLeds(LedName[], Color)
Sets the color of the specified LEDs on enabled devices to the specified color.
public static bool SetColorForLeds(LedName[] ledNames, Color color);
Parameters
ledNames LedName[]
The LED Name values for the LEDs to be set.
color Color
The color to set. On monochromatic devices, only the highest channel value is used.
Returns
bool
True if specified LEDs on any enabled device was successfully set.

Shutdown()
Manually shut down the Spectral library. If not called, the library should shutdown when the application
exits.
public static void Shutdown();



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.7
Linearized                      : No
Page Count                      : 9
Language                        : en-US
Tagged PDF                      : Yes
XMP Toolkit                     : 3.1-701
Producer                        : Microsoft® Word 2016
Creator                         : Jonathan Potts
Creator Tool                    : Microsoft® Word 2016
Create Date                     : 2018:06:18 17:39:53-07:00
Modify Date                     : 2018:06:18 17:39:53-07:00
Document ID                     : uuid:E9EE78C9-A061-4A40-9E0F-264C86ABAE6F
Instance ID                     : uuid:E9EE78C9-A061-4A40-9E0F-264C86ABAE6F
Author                          : Jonathan Potts
EXIF Metadata provided by EXIF.tools

Navigation menu