GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
al_color_linear(3) FreeBSD Library Functions Manual al_color_linear(3)

al_color_linear - Allegro 5 API

#include <allegro5/allegro_color.h>
ALLEGRO_COLOR al_color_linear(float r, float g, float b)
    

Return an ALLEGRO_COLOR(3) structure from linear sRGB values. Allegro RGB values are assumed to be sRGB. The sRGB standard is in wide use by various display devices. It accounts for a standard gamma correction applied to RGB colors before they get displayed.

Gamma correction means if for example we have a medium gray color specified with al_map_rgb_f(0.5,0.5,0.5) then we do not want the monitor to set the pixel to exactly half the physical maximum intensity, but instead to an intensity that appears to be half as bright as the maximum to the person looking at it. In this case that would be closer to 21% of maximum intensity rather than to 50% intensity.

For some applications it may be useful to specify a color in linear sRGB components, in which case you can use this function. For example:

ALLEGRO_COLOR gray = al_color_linear(0.216, 0.216, 0.216);
char html[8];
al_color_rgb_to_html(gray.r, gray.g, gray.b, html); // "#808080"
    

5.2.8

al_color_linear_to_rgb(3), al_color_rgb_to_linear(3)

Allegro reference manual

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.