Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

ColourFX Class

Support for applying colour transformation effects.

Use ColourFX to perform colour transformations on an input source. A Mode must be selected and any required Values defined prior to rendering.

SVG requires that the calculations are performed on non-premultiplied colour values. If the input graphics consists of premultiplied colour values, those values are automatically converted into non-premultiplied colour values for this operation.

Structure

The ColourFX class consists of the following fields:

Access
NameTypeComment
  ModeINTDefines the algorithm that will process the input source.
NameDescription
CM::BRIGHTNESSAdjust brightness using the first parameter to define the intensity.
CM::COLOURISEColourise the input with the first 3 parameters used as RGB multipliers and the fourth parameter controlling intensity from 0 - 1.0.
CM::CONTRASTAdjust contrast using the first parameter to define the intensity from -1.0 to 1.0.
CM::DESATURATEDesaturate the input completely so that it is rendered in greyscale.
CM::HUEAdjust the hue by 0 - 360 degrees using the first parameter.
CM::HUE_ROTATERotate the hue by 0 - 360 degrees, controlled by the first parameter.
CM::LUMINANCE_ALPHAConverts each RGB value to greyscale, which then overrides the alpha channel.
CM::MATRIXProcess the supplied 5x4 matrix values.
CM::NONEDo nothing.
CM::SATURATEAdjust colour saturation with the first parameter defining the multiplier.
  ValuesDOUBLE []A list of input values for the algorithm defined by Mode.

The meaning of the input values is dependent on the selected Mode. Each mode documents the total number of values that must be defined for them to work properly.

When values are not defined, they default to 0.

  XMLDefSTRINGReturns an SVG compliant XML string that describes the effect.

Actions

The following actions are currently supported:

DrawRender the effect to the target bitmap.
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
ParameterDescription
XThe X position of the region to be drawn.
YThe Y position of the region to be drawn.
WidthThe width of the region to be drawn.
HeightThe height of the region to be drawn.
ColourFX class documentation © Paul Manias © 2010-2025

CM Type

Colour modes for ColourFX.

NameDescription
CM::BRIGHTNESSAdjust brightness using the first parameter to define the intensity.
CM::COLOURISEColourise the input with the first 3 parameters used as RGB multipliers and the fourth parameter controlling intensity from 0 - 1.0.
CM::CONTRASTAdjust contrast using the first parameter to define the intensity from -1.0 to 1.0.
CM::DESATURATEDesaturate the input completely so that it is rendered in greyscale.
CM::HUEAdjust the hue by 0 - 360 degrees using the first parameter.
CM::HUE_ROTATERotate the hue by 0 - 360 degrees, controlled by the first parameter.
CM::LUMINANCE_ALPHAConverts each RGB value to greyscale, which then overrides the alpha channel.
CM::MATRIXProcess the supplied 5x4 matrix values.
CM::NONEDo nothing.
CM::SATURATEAdjust colour saturation with the first parameter defining the multiplier.
ColourFX module documentation © Paul Manias © 2010-2025