IColourSpace

References
public interface IColourSpace
Base interface for all colour models.

Properties

Colour

#
Colour Colour { get; }
Gets the colour currently selected in this model.

Filter

#
NamedPalette Filter { get; set; }
Gets or sets the source for allowed colours. When not null, this property will limit displayed colours to the defined set of colours in the filter. Assigning a new filter will automatically wipe the display caches. Note that not all models necessarily constrain themselves to a filter, this property is a hint as much as anything.

Format

#
string Format { get; }
Format the current model state.

Icon

#
IIcon Icon { get; }
Gets the icon associated with this model.

Nomen

#
Nomen Nomen { get; }
Gets the description of this model.

Methods

Draw

#
void Draw(Context context, RectangleF bounds, ColourModelVisuals visuals)
Draw this colour model into a graphics context.
context (Context)Context to draw with.
bounds (RectangleF)Target bounds for model.
visuals (ColourModelVisuals)Visual properties.

GetChannels

#
void GetChannels(out UiNumber channel1, out UiNumber channel2, out UiNumber channel3)
Gets the channel values of the current space. The current design of this api does not allow for a varying number of channels. This is potentially a big problem, potentially not. At present the only colour model which requires more than three channels is CMYK.
channel1 (out UiNumber)Properties of first channel.
channel2 (out UiNumber)Properties of second channel.
channel3 (out UiNumber)Properties of third channel.

RespondToMouseDown

#
object RespondToMouseDown(PointF mouse, MouseButtons buttons)
Respond to a mouse down event on this model.
mouse (PointF)Mouse coordinate.
buttons (MouseButtons)Mouse buttons.
Motion record specific to this model.

RespondToMouseMove

#
void RespondToMouseMove(object motionData, PointF mouse, MouseButtons buttons, Keys keys)
Respond to a mouse move event. These are only relayed when at least one mouse button is down.
motionData (object)Mouse move begin record.
mouse (PointF)New mouse location.
buttons (MouseButtons)Mouse buttons involved.
keys (Keys)Modifier keys involved.

RespondToMouseUp

#
void RespondToMouseUp(object motionData, PointF mouse, MouseButtons buttons, Keys keys)
Respond to a mouse up event.
motionData (object)
mouse (PointF)
buttons (MouseButtons)
keys (Keys)

SetChannels

#
void SetChannels(UiNumber channel1, UiNumber channel2, UiNumber channel3)
Update the colour from channels.
channel1 (UiNumber)First channel.
channel2 (UiNumber)Second channel.
channel3 (UiNumber)Third channel.

SetColour

#
void SetColour(Colour colour)
Change this colour model to reflect a given colour. There is no guarantee that the model colour will be exactly equal to the given colour, there may be both rounding errors as well as gamut constraints.
colour (Colour)Colour to match.