CSFML

- Main Page
- Data Structures
- Files

- File List
- Globals

Data Structures | Functions | Variables
Color.h File Reference
`#include <SFML/Graphics/Export.h>`

Go to the source code of this file.

## Data Structures
struct | sfColor
| Utility class for manpulating RGBA colors. More...

## Functions
CSFML_GRAPHICS_API sfColor | sfColor_fromRGB (sfUint8 red, sfUint8 green, sfUint8 blue)
| Construct a color from its 3 RGB components. More...
CSFML_GRAPHICS_API sfColor | sfColor_fromRGBA (sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
| Construct a color from its 4 RGBA components. More...
CSFML_GRAPHICS_API sfColor | sfColor_add (sfColor color1, sfColor color2)
| Add two colors. More...
CSFML_GRAPHICS_API sfColor | sfColor_modulate (sfColor color1, sfColor color2)
| Modulate two colors. More...

## Variables
CSFML_GRAPHICS_API sfColor | sfBlack
| Black predefined color. More...
CSFML_GRAPHICS_API sfColor | sfWhite
| White predefined color. More...
CSFML_GRAPHICS_API sfColor | sfRed
| Red predefined color. More...
CSFML_GRAPHICS_API sfColor | sfGreen
| Green predefined color. More...
CSFML_GRAPHICS_API sfColor | sfBlue
| Blue predefined color. More...
CSFML_GRAPHICS_API sfColor | sfYellow
| Yellow predefined color. More...
CSFML_GRAPHICS_API sfColor | sfMagenta
| Magenta predefined color. More...
CSFML_GRAPHICS_API sfColor | sfCyan
| Cyan predefined color. More...
CSFML_GRAPHICS_API sfColor | sfTransparent
| Transparent (black) predefined color. More...

## Function Documentation

CSFML_GRAPHICS_API sfColor sfColor_add | ( | sfColor | color1,
|  | sfColor | color2
| ) |  |

Add two colors.

Parameters

  color1 | First color
  color2 | Second color

Returns
  Component-wise saturated addition of the two colors

CSFML_GRAPHICS_API sfColor sfColor_fromRGB | ( | sfUint8 | red,
|  | sfUint8 | green,
|  | sfUint8 | blue
| ) |  |

Construct a color from its 3 RGB components.

Parameters

  red | Red component (0 .. 255)
  green | Green component (0 .. 255)
  blue | Blue component (0 .. 255)

Returns
  sfColor constructed from the components

CSFML_GRAPHICS_API sfColor sfColor_fromRGBA | ( | sfUint8 | red,
|  | sfUint8 | green,
|  | sfUint8 | blue,
|  | sfUint8 | alpha
| ) |  |

Construct a color from its 4 RGBA components.

Parameters

  red | Red component (0 .. 255)
  green | Green component (0 .. 255)
  blue | Blue component (0 .. 255)
  alpha | Alpha component (0 .. 255)

Returns
  sfColor constructed from the components

CSFML_GRAPHICS_API sfColor sfColor_modulate | ( | sfColor | color1,
|  | sfColor | color2
| ) |  |

Modulate two colors.

Parameters

  color1 | First color
  color2 | Second color

Returns
  Component-wise multiplication of the two colors

## Variable Documentation

CSFML_GRAPHICS_API sfColor sfBlack

Black predefined color.

Definition at line 47 of file Color.h.

CSFML_GRAPHICS_API sfColor sfBlue

Blue predefined color.

Definition at line 51 of file Color.h.

CSFML_GRAPHICS_API sfColor sfCyan

Cyan predefined color.

Definition at line 54 of file Color.h.

CSFML_GRAPHICS_API sfColor sfGreen

Green predefined color.

Definition at line 50 of file Color.h.

CSFML_GRAPHICS_API sfColor sfMagenta

Magenta predefined color.

Definition at line 53 of file Color.h.

CSFML_GRAPHICS_API sfColor sfRed

Red predefined color.

Definition at line 49 of file Color.h.

CSFML_GRAPHICS_API sfColor sfTransparent

Transparent (black) predefined color.

Definition at line 55 of file Color.h.

CSFML_GRAPHICS_API sfColor sfWhite

White predefined color.

Definition at line 48 of file Color.h.

CSFML_GRAPHICS_API sfColor sfYellow

Yellow predefined color.

Definition at line 52 of file Color.h.