Module dlangui.graphics.colors

This module contains declaration of useful color related operations.

In dlangui, colors are represented as 32 bit uint AARRGGBB values.

Synopsis

import dlangui.graphics.colors;

Functions

Name Description
addAlpha applies additional alpha to color
blendAlpha blend two alpha values 0..255 (255 is fully transparent, 0 is opaque)
blendARGB blend two RGB pixels using alpha
blendGray blend two RGB pixels using alpha
blendSubpixel blend subpixel using alpha
decodeHexColor decode color string supported formats: #RGB #ARGB #RRGGBB #AARRGGBB
isFullyTransparentColor returns true if color is #FFxxxxxx (color alpha is 255)
makeRGBA
rgbToGray
subpixelComponentIndex
transformComponent
transformRGBA

Structs

Name Description
ColorTransform
ColorTransformHandler

Global variables

Name Type Description
COLOR_TRANSFORM_MULTIPLY_NONE immutable(uint)
COLOR_TRANSFORM_OFFSET_NONE immutable(uint)
COLOR_TRANSPARENT immutable(uint) transparent color constant
COLOR_UNSPECIFIED immutable(uint) special color constant to identify value as not a color (to use default/parent value instead)
COMPONENT_OFFSET_ALPHA immutable(int)
COMPONENT_OFFSET_BGR immutable(int[3])
COMPONENT_OFFSET_RGB immutable(int[3])

Authors

Vadim Lopatin, coolreader.org@gmail.com

Copyright

Vadim Lopatin, 2015

License

Boost License 1.0