Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

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.

The matrix is applied in the colour space defined by the parent VectorFilter's ColourSpace field. If set to LINEAR_RGB (the SVG default) then pixel values are converted to linear RGB prior to transformation and back to sRGB on output, otherwise the transformation is performed directly on the sRGB values.

Structure

The ColourFX class consists of the following fields:

Access
NameTypeComment
 ModeCMDefines 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-2026

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-2026