Previous: 4.51.2.4.44. ogRGB() To the Table of Contents Next: 4.51.2.4.46. ogSavePal()
4.51.2.4.44. ogRGB() Table of Contents 4.51.2.4.46. ogSavePal()

- 4.51.2.4.45. -
Table of Contents
4. Standard Units
4.51. ObjGfx40 - ObjectGraphics 4.0 Unit
4.51.2. ObjGfx40 Unit Object Types
4.51.2.4. ogSurface object
4.51.2.4.45. ogRGBA()


4.51.2.4.45. ogRGBA()

Targets: MS-DOS, Win32 console


ObjGfx40 Unit

Converts an RGB triplet into a packed pixel with alpha information.

Declaration:
  function ogRGBA(red, green, blue, alpha:uInt8):uInt32;
Remarks:

For all high-colour and true-colour surface, this will pack the pixel based on the pixel format of the surface. Different surface can have different RGB orderings and sizes, so it is advised one use this function to generate colour values for other functions. For 8BPP buffers, this function will return the closest colour to the requested RGB value using an imperfect colour matching algorithm.

A totally opaque pixel has an alpha level of 255.
A totally transparent pixel has an alpha level of 0.
How the pixel is rendered to the surface depends on the drawing function and whether or not blending is enabled.

Restrictions:

RGB channels are at most 8-bits wide. This will be changed in a future revision. Will only return a packed pixel for surface with a bitdepth of 8, 15, 16, 24, and 32.

See also:


Previous: 4.51.2.4.44. ogRGB() To the Table of Contents Next: 4.51.2.4.46. ogSavePal()
4.51.2.4.44. ogRGB() Table of Contents 4.51.2.4.46. ogSavePal()

- 4.51.2.4.45. -