ColorPicker Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Example script to demonstrate adding buttons, sliders and a touchable gradient to control material values at runtime.
public ref class ColorPicker : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::Input::IMixedRealityTouchHandler, UnityEngine::EventSystems::IEventSystemHandler
public class ColorPicker : UnityEngine.MonoBehaviour, Microsoft.MixedReality.Toolkit.Input.IMixedRealityTouchHandler, UnityEngine.EventSystems.IEventSystemHandler
type ColorPicker = class
inherit MonoBehaviour
interface IMixedRealityTouchHandler
interface IEventSystemHandler
Public Class ColorPicker
Inherits MonoBehaviour
Implements IEventSystemHandler, IMixedRealityTouchHandler
- Inheritance
-
UnityEngine.MonoBehaviourColorPicker
- Implements
-
IMixedRealityTouchHandler UnityEngine.EventSystems.IEventSystemHandler
Constructors
ColorPicker() |
Properties
TargetObjectMesh | |
TargetObjectSprite |
Methods
ClickGradientTexture(MixedRealityPointerEventData) |
Touching the gradient texture will calculate the color and constrain the dragger based on the point in eventData |
ExtractColorFromMaterial(MeshRenderer) |
Extracts a color from a MeshRenderer and applies it to the color picker |
StartDrag(GameObject) |
Tells the update loop that a slider knob is being dragged |
StartDragGradient() |
Tells the update loop that the gradient is being dragged |
StopDrag(GameObject) |
Tells the update loop that a slider knob is not being dragged and applies the value to all sliders |
StopDragGradient() |
Tells the update loop that the gradient is not being dragged, and applies the updated color value to the sliders |
SummonColorPicker(GameObject) |
This will set the visibility, scale, and position of the color picker while extracting the color of the touched object's MeshRenderer or SpriteRender |
UpdateColorHSV() |
Applies Hue, Saturation, Brightness slider values to the Red, Green, Blue sliders |
UpdateColorRGB() |
Applies Red, Green, Blue slider values to the Hue, Saturation, Brightness sliders |