CSFML 2.6.1

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Loading...
Searching...
No Matches
Classes | Functions | Variables
Color.h File Reference
`#include <SFML/Graphics/Export.h>`

Go to the source code of this file.

## Classes

struct | sfColor
| Utility class for manpulating RGBA colors. More...

## Functions

sfColor | sfColor_fromRGB (sfUint8 red, sfUint8 green, sfUint8 blue)
| Construct a color from its 3 RGB components.
sfColor | sfColor_fromRGBA (sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
| Construct a color from its 4 RGBA components.
sfColor | sfColor_fromInteger (sfUint32 color)
| Construct the color from 32-bit unsigned integer.
sfUint32 | sfColor_toInteger (sfColor color)
| Convert a color to a 32-bit unsigned integer.
sfColor | sfColor_add (sfColor color1, sfColor color2)
| Add two colors.
sfColor | sfColor_subtract (sfColor color1, sfColor color2)
| Subtract two colors.
sfColor | sfColor_modulate (sfColor color1, sfColor color2)
| Modulate two colors.

## Variables

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

## Function Documentation

## ◆ sfColor_add()

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

## ◆ sfColor_fromInteger()

sfColor sfColor_fromInteger | ( | sfUint32 | color | ) |

Construct the color from 32-bit unsigned integer.

Parameters

  color | Number containing the RGBA components (in that order)

Returns
  sfColor constructed from the 32-bit unsigned integer

## ◆ sfColor_fromRGB()

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

## ◆ sfColor_fromRGBA()

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

## ◆ sfColor_modulate()

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

## ◆ sfColor_subtract()

sfColor sfColor_subtract | ( | sfColor | color1,
|  | sfColor | color2
| ) |  |

Subtract two colors.

Parameters

  color1 | First color
  color2 | Second color

Returns
  Component-wise saturated subtraction of the two colors

## ◆ sfColor_toInteger()

sfUint32 sfColor_toInteger | ( | sfColor | color | ) |

Convert a color to a 32-bit unsigned integer.

Returns
  Color represented as a 32-bit unsigned integer

## Variable Documentation

## ◆ sfBlack

sfColor sfBlack

Black predefined color.

Definition at line 47 of file Color.h.

## ◆ sfBlue

sfColor sfBlue

Blue predefined color.

Definition at line 51 of file Color.h.

## ◆ sfCyan

sfColor sfCyan

Cyan predefined color.

Definition at line 54 of file Color.h.

## ◆ sfGreen

sfColor sfGreen

Green predefined color.

Definition at line 50 of file Color.h.

## ◆ sfMagenta

sfColor sfMagenta

Magenta predefined color.

Definition at line 53 of file Color.h.

## ◆ sfRed

sfColor sfRed

Red predefined color.

Definition at line 49 of file Color.h.

## ◆ sfTransparent

sfColor sfTransparent

Transparent (black) predefined color.

Definition at line 55 of file Color.h.

## ◆ sfWhite

sfColor sfWhite

White predefined color.

Definition at line 48 of file Color.h.

## ◆ sfYellow

sfColor sfYellow

Yellow predefined color.

Definition at line 52 of file Color.h.