![]()  | 
  
    Gamedev Framework (gf)
    0.11.0
    
   A C++14 framework for 2D games 
   | 
 
Predefined colors. More...
#include <gf/Color.h>
Public Member Functions | |
| Color ()=delete | |
| Deleted constructor.  More... | |
Static Public Member Functions | |
| static constexpr Color4f | Opaque (float value=0.5f) | 
| Opaque predefined color.  More... | |
| static constexpr Color4f | Gray (float value=0.5f) | 
| Gray predefined color.  More... | |
| static Color4f | lighter (Color4f color, float percent=0.5f) | 
| Compute a lighter color.  More... | |
| static Color4f | darker (Color4f color, float percent=0.5f) | 
| Compute a darker color.  More... | |
| static Color4f | fromRgbF (float r, float g, float b) | 
| Get an opaque color from 3 RGB floats in \( [0, 1] \).  More... | |
| static Color4f | fromRgba32 (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) | 
| Get a color from 4 8-bit channels.  More... | |
| static Color4f | fromRgba32 (uint32_t color) | 
| Get a color from 32-bit value.  More... | |
| static Color4f | fromRgba32 (Color4u color) | 
| Get a color from a 32-bit color.  More... | |
| static Color4u | toRgba32 (Color4f color) | 
| Convert a color to a 32-bit color.  More... | |
Static Public Attributes | |
| static constexpr Color4f | Black {0.0f, 0.0f, 0.0f, 1.0f} | 
| Black predefined color.  More... | |
| static constexpr Color4f | White {1.0f, 1.0f, 1.0f, 1.0f} | 
| White predefined color.  More... | |
| static constexpr Color4f | Red {1.0f, 0.0f, 0.0f, 1.0f} | 
| Red predefined color.  More... | |
| static constexpr Color4f | Green {0.0f, 1.0f, 0.0f, 1.0f} | 
| Green predefined color.  More... | |
| static constexpr Color4f | Blue {0.0f, 0.0f, 1.0f, 1.0f} | 
| Blue predefined color.  More... | |
| static constexpr Color4f | Cyan {0.0f, 1.0f, 1.0f, 1.0f} | 
| Cyan predefined color.  More... | |
| static constexpr Color4f | Magenta {1.0f, 0.0f, 1.0f, 1.0f} | 
| Magenta predefined color.  More... | |
| static constexpr Color4f | Yellow {1.0f, 1.0f, 0.0f, 1.0f} | 
| Yellow predefined color.  More... | |
| static constexpr Color4f | Transparent {0.0f, 0.0f, 0.0f, 0.0f} | 
| Transparent (black) predefined color.  More... | |
| static constexpr Color4f | Orange {1.0f, 0.5f, 0.0f, 1.0f} | 
| Orange predefined color.  More... | |
| static constexpr Color4f | Rose {1.0f, 0.0f, 0.5f, 1.0f} | 
| Rose predefined color.  More... | |
| static constexpr Color4f | Chartreuse {0.5f, 1.0f, 0.0f, 1.0f} | 
| Chartreuse predefined color.  More... | |
| static constexpr Color4f | Spring {0.0f, 1.0f, 0.5f, 1.0f} | 
| Spring (green) predefined color.  More... | |
| static constexpr Color4f | Violet {0.5f, 0.0f, 1.0f, 1.0f} | 
| Violet predefined color.  More... | |
| static constexpr Color4f | Azure {0.0f, 0.5f, 1.0f, 1.0f} | 
| Azure predefined color.  More... | |
Predefined colors.
This class does not contain anything but predefined colors. All the primary, secondary and tertiary colors are defined by their usual names.
If you want to define a color, you should use gf::Color4f.
      
  | 
  delete | 
Deleted constructor.
Compute a darker color.
This function takes a color and gives a darker color based on a percentage. If this percentage is 0, the same color is returned. If this percentage is 1, the black color is returned.
| color | The color | 
| percent | The percentage, must be in \( [0, 1] \) | 
      
  | 
  static | 
Get a color from 4 8-bit channels.
| r | The red channel | 
| g | The green channel | 
| b | The blue channel | 
| a | The alpha channel | 
      
  | 
  static | 
Get a color from 32-bit value.
| color | The 32-bit color | 
Get a color from a 32-bit color.
| color | A 32-bit color | 
      
  | 
  inlinestatic | 
Get an opaque color from 3 RGB floats in \( [0, 1] \).
| r | The red channel | 
| g | The green channel | 
| b | The blue channel | 
      
  | 
  inlinestatic | 
Gray predefined color.
| value | The gray value | 
Compute a lighter color.
This function takes a color and gives a lighter color based on a percentage. If this percentage is 0, the same color is returned. If this percentage is 1, the white color is returned.
| color | The color | 
| percent | The percentage, must be in \( [0, 1] \) | 
      
  | 
  inlinestatic | 
Opaque predefined color.
| value | The opacity value | 
Convert a color to a 32-bit color.
| color | A color | 
      
  | 
  static | 
Azure predefined color.
      
  | 
  static | 
Black predefined color.
      
  | 
  static | 
Blue predefined color.
      
  | 
  static | 
Chartreuse predefined color.
      
  | 
  static | 
Cyan predefined color.
      
  | 
  static | 
Green predefined color.
      
  | 
  static | 
Magenta predefined color.
      
  | 
  static | 
Orange predefined color.
      
  | 
  static | 
Red predefined color.
      
  | 
  static | 
Rose predefined color.
      
  | 
  static | 
Spring (green) predefined color.
      
  | 
  static | 
Transparent (black) predefined color.
      
  | 
  static | 
Violet predefined color.
      
  | 
  static | 
White predefined color.
      
  | 
  static | 
Yellow predefined color.
 1.8.13