Add RGB constructor to color
This commit is contained in:
		
							parent
							
								
									6fcfcd09b5
								
							
						
					
					
						commit
						9fef3c33d2
					
				
					 2 changed files with 13 additions and 2 deletions
				
			
		|  | @ -279,12 +279,22 @@ Color::Color() | |||
| { } | ||||
| 
 | ||||
| 
 | ||||
| /*
 | ||||
|  * Color::Color -- | ||||
|  * | ||||
|  * Constructor. Create a new Color with the given RGB components. Alpha is 1.0. | ||||
|  */ | ||||
| Color::Color(const float &r, const float &g, const float &b) | ||||
|     : Color(r, g, b, 1.0) | ||||
| { } | ||||
| 
 | ||||
| 
 | ||||
| /*
 | ||||
|  * Color::Color -- | ||||
|  * | ||||
|  * Constructor. Create a new Color with the given components. | ||||
|  */ | ||||
| Color::Color(float r, float g, float b, float a) | ||||
| Color::Color(const float &r, const float &g, const float &b, const float &a) | ||||
|     : red(r), green(g), blue(b), alpha(a) | ||||
| { } | ||||
| 
 | ||||
|  |  | |||
|  | @ -58,7 +58,8 @@ struct Ray | |||
| struct Color | ||||
| { | ||||
|     Color(); | ||||
|     Color(float r, float g, float b, float a); | ||||
|     Color(const float &r, const float &g, const float &b); | ||||
|     Color(const float &r, const float &g, const float &b, const float &a); | ||||
| 
 | ||||
|     Color &operator*=(const float &rhs); | ||||
|     Color &operator/=(const float &rhs); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue