Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Color Struct Reference

#include <color.h>

Public Member Functions

bool operator== (const Color &p_color) const
 
bool operator!= (const Color &p_color) const
 
uint32_t to_32 () const
 
uint32_t to_ARGB32 () const
 
float gray () const
 
float get_h () const
 
float get_s () const
 
float get_v () const
 
void set_hsv (float p_h, float p_s, float p_v, float p_alpha=1.0)
 
_FORCE_INLINE_ float & operator[] (int idx)
 
_FORCE_INLINE_ const float & operator[] (int idx) const
 
void invert ()
 
void contrast ()
 
Color inverted () const
 
Color contrasted () const
 
_FORCE_INLINE_ Color linear_interpolate (const Color &p_b, float p_t) const
 
_FORCE_INLINE_ Color blend (const Color &p_over) const
 
_FORCE_INLINE_ Color to_linear () const
 
String to_html (bool p_alpha=true) const
 
_FORCE_INLINE_ bool operator< (const Color &p_color) const
 
 operator String () const
 
_FORCE_INLINE_ Color ()
 
_FORCE_INLINE_ Color (float p_r, float p_g, float p_b, float p_a=1.0)
 

Static Public Member Functions

static Color hex (uint32_t p_hex)
 
static Color html (const String &p_color)
 
static bool html_is_valid (const String &p_color)
 

Public Attributes

union {
   struct {
      float   r
 
      float   g
 
      float   b
 
      float   a
 
   } 
 
   float   components [4]
 
}; 
 

Detailed Description

Author
Juan Linietsky reduz.nosp@m.io@g.nosp@m.mail..nosp@m.com

Constructor & Destructor Documentation

_FORCE_INLINE_ Color::Color ( )
inline

No construct parameters, r=0, g=0, b=0. a=255

_FORCE_INLINE_ Color::Color ( float  p_r,
float  p_g,
float  p_b,
float  p_a = 1.0 
)
inline

RGB / RGBA construct parameters. Alpha is optional, but defaults to 1.0


The documentation for this struct was generated from the following files: