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;

Members

Enums

Color
enum Color

Color constants enum, contributed by zhaopuming refer to http://rapidtables.com/web/color/RGB_Color.htm#color%20table #275

Functions

addAlpha
uint addAlpha(uint color, uint alpha)

applies additional alpha to color

blendARGB
uint blendARGB(uint dst, uint src, uint alpha)

blend two RGB pixels using alpha

blendAlpha
uint blendAlpha(uint a1, uint a2)

blend two alpha values 0..255 (255 is fully transparent, 0 is opaque)

blendGray
ubyte blendGray(ubyte dst, ubyte src, uint alpha)

blend two RGB pixels using alpha

blendSubpixel
void blendSubpixel(ubyte* dst, ubyte* src, uint alpha, int x0, SubpixelRenderingMode mode)

blend subpixel using alpha

decodeHexColor
uint decodeHexColor(string s, uint defValue)

decode color string supported formats: #RGB #ARGB #RRGGBB #AARRGGBB

isFullyTransparentColor
bool isFullyTransparentColor(uint color)

returns true if color is #FFxxxxxx (color alpha is 255)

makeRGBA
uint makeRGBA(T r, T g, T b, T a)
Undocumented in source. Be warned that the author may not have intended to support it.
rgbToGray
ubyte rgbToGray(uint color)
Undocumented in source. Be warned that the author may not have intended to support it.
subpixelComponentIndex
int subpixelComponentIndex(int x0, SubpixelRenderingMode mode)
Undocumented in source. Be warned that the author may not have intended to support it.
transformComponent
uint transformComponent(int src, int addBefore, int multiply, int addAfter)
Undocumented in source. Be warned that the author may not have intended to support it.
transformRGBA
uint transformRGBA(uint src, uint addBefore, uint multiply, uint addAfter)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

ColorTransform
struct ColorTransform
Undocumented in source.
ColorTransformHandler
struct ColorTransformHandler
Undocumented in source.

Variables

COLOR_DRAWABLE
string COLOR_DRAWABLE;
Undocumented in source.
COLOR_TRANSFORM_MULTIPLY_NONE
uint COLOR_TRANSFORM_MULTIPLY_NONE;
Undocumented in source.
COLOR_TRANSFORM_OFFSET_NONE
uint COLOR_TRANSFORM_OFFSET_NONE;
Undocumented in source.
COLOR_TRANSPARENT
uint COLOR_TRANSPARENT;

transparent color constant

COLOR_UNSPECIFIED
uint COLOR_UNSPECIFIED;

special color constant to identify value as not a color (to use default/parent value instead)

COMPONENT_OFFSET_ALPHA
int COMPONENT_OFFSET_ALPHA;
Undocumented in source.
COMPONENT_OFFSET_BGR
int[3] COMPONENT_OFFSET_BGR;
Undocumented in source.
COMPONENT_OFFSET_RGB
int[3] COMPONENT_OFFSET_RGB;
Undocumented in source.

Meta

License

Boost License 1.0

Authors

Vadim Lopatin, coolreader.org@gmail.com