Skip to content

XUIColorSwatchRendererMacOS

Implements XUIColorSwatchRenderer

Description

Renders a color swatch mimicking macOS.

Properties

Name Type Read-Only
mActiveBackgroundColor ColorGroup
mBackgroundColor ColorGroup
mInnerBorderColor ColorGroup
mOuterBorderColor ColorGroup
mOwner WeakRef

Methods

Name Parameters Returns
Constructor owner As XUIColorSwatch
InitialiseColorGroups
Owner XUIColorSwatch
RecommendedHeight Double
RecommendedWidth Double
Render g As Graphics

Constants

Name Type
ACTIVE_BACKGROUND_COLOR_DARK Color
ACTIVE_BACKGROUND_COLOR_LIGHT Color
BACKGROUND_COLOR_DARK Color
BACKGROUND_COLOR_LIGHT Color
INNER_BORDER_COLOR_DARK Color
INNER_BORDER_COLOR_LIGHT Color
OUTER_BORDER_COLOR_DARK Color
OUTER_BORDER_COLOR_LIGHT Color

ACTIVE_BACKGROUND_COLOR_DARK As Color The dark mode colour for the background when the colour swatch is active.


ACTIVE_BACKGROUND_COLOR_LIGHT As Color The light mode colour for the background when the colour swatch is active.


BACKGROUND_COLOR_DARK As Color The dark mode colour for the background.


BACKGROUND_COLOR_LIGHT As Color The light mode colour for the background.


INNER_BORDER_COLOR_DARK As Color The dark mode colour for the inner border.


INNER_BORDER_COLOR_LIGHT As Color The light mode colour for the inner border.


OUTER_BORDER_COLOR_DARK As Color The dark mode colour for the outer border.


OUTER_BORDER_COLOR_LIGHT As Color The light mode colour for the outer border.


Property Descriptions

mActiveBackgroundColor As ColorGroup

The colour to use for the swatch background when active.


mBackgroundColor As ColorGroup

The colour to use for the swatch's background when non-active.


mInnerBorderColor As ColorGroup

The colour to use for the inner border.


mOuterBorderColor As ColorGroup

The colour to use for the outer border.


mOwner As WeakRef

A weak reference to the owning ColorSwatch.


Method Descriptions

Constructor(owner As XUIColorSwatch)

Default constructor.

  • owner is the XUIColorSwatch that owns this renderer. A new WeakRef to it will be created.

InitialiseColorGroups()

Initialises the ColorGroup properties from our built-in constants.


Owner() As XUIColorSwatch

This renderer's owning ColorSwatch.

Part of the XUIColorSwatchRenderer interface.


RecommendedHeight() As Double

The recommended height (in pixels) the colour swatch should be.

Part of the XUIColorSwatchRenderer interface.


RecommendedWidth() As Double

The recommended width (in pixels) the colour swatch should be.

Part of the XUIColorSwatchRenderer interface.


Render(g As Graphics)

Renders the swatch to the passed graphics context.

Part of the XUIColorSwatchRenderer interface.