Spinning Topp Logo BlackTopp Studios
inc
colourvalue.cpp
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _colourvalue_cpp
41 #define _colourvalue_cpp
42 
43 #include "colourvalue.h"
44 #include "stringtool.h"
45 #include "serialization.h"
46 #include "exception.h"
47 
48 #include <Ogre.h>
49 
50 #include <memory>
51 namespace Mezzanine
52 {
53  ColourValue::ColourValue(Real Red, Real Green, Real Blue, Real Alpha)
54  {
55  this->RedChannel = Red;
56  this->GreenChannel = Green;
57  this->BlueChannel = Blue;
58  this->AlphaChannel = Alpha;
59  }
60 
61  ColourValue::ColourValue(const Ogre::ColourValue& OgreValues)
62  {
63  this->RedChannel = OgreValues.r;
64  this->GreenChannel = OgreValues.g;
65  this->BlueChannel = OgreValues.b;
66  this->AlphaChannel = OgreValues.a;
67  }
68 
70  {
71  this->RedChannel = OtherColour.RedChannel;
72  this->GreenChannel = OtherColour.GreenChannel;
73  this->BlueChannel = OtherColour.BlueChannel;
74  this->AlphaChannel = OtherColour.AlphaChannel;
75  }
76 
78  { this->ProtoDeSerialize(OneNode); }
79 
81  { }
82 
83  ///////////////////////////////////////////////////////////////////////////////
84  // Conversion Methods
85 
86  Ogre::ColourValue ColourValue::GetOgreColourValue() const
87  {
88  Ogre::ColourValue OgreColour;
89  OgreColour.r = this->RedChannel;
90  OgreColour.g = this->GreenChannel;
91  OgreColour.b = this->BlueChannel;
92  OgreColour.a = this->AlphaChannel;
93  return OgreColour;
94  }
95 
96  ///////////////////////////////////////////////////////////////////////////////
97  // Utility
98 
100  { this->RedChannel = Red; }
101 
103  { return this->RedChannel; }
104 
106  { this->GreenChannel = Green; }
107 
109  { return this->GreenChannel; }
110 
112  { this->BlueChannel = Blue; }
113 
115  { return this->BlueChannel; }
116 
118  { this->AlphaChannel = Alpha; }
119 
121  { return this->AlphaChannel; }
122 
123  void ColourValue::SetValues(const Real Red, const Real Green, const Real Blue, const Real Alpha)
124  {
125  this->RedChannel = Red;
126  this->GreenChannel = Green;
127  this->BlueChannel = Blue;
128  this->AlphaChannel = Alpha;
129  }
130 
132  {
133  return ColourValue( ( this->RedChannel + OtherColor.RedChannel ) * 0.5,
134  ( this->GreenChannel + OtherColor.GreenChannel ) * 0.5,
135  ( this->BlueChannel + OtherColor.BlueChannel ) * 0.5,
136  ( this->AlphaChannel + OtherColor.AlphaChannel ) * 0.5 );
137  }
138 
139  ///////////////////////////////////////////////////////////////////////////////
140  // Overloaded Operators
141 
143  { return ColourValue( this->RedChannel * Scalar, this->GreenChannel * Scalar, this->BlueChannel * Scalar, this->AlphaChannel * Scalar); }
144 
146  { return ColourValue( this->RedChannel + Colour.RedChannel, this->GreenChannel + Colour.GreenChannel, this->BlueChannel + Colour.BlueChannel, this->AlphaChannel + Colour.AlphaChannel ); }
147 
149  { return ColourValue( this->RedChannel - Colour.RedChannel, this->GreenChannel - Colour.GreenChannel, this->BlueChannel - Colour.BlueChannel, this->AlphaChannel - Colour.AlphaChannel ); }
150 
152  { return ColourValue( this->RedChannel * Colour.RedChannel, this->GreenChannel * Colour.GreenChannel, this->BlueChannel * Colour.BlueChannel, this->AlphaChannel * Colour.AlphaChannel ); }
153 
155  { this->SetValues( this->RedChannel + Colour.RedChannel, this->GreenChannel + Colour.GreenChannel, this->BlueChannel + Colour.BlueChannel, this->AlphaChannel + Colour.AlphaChannel ); return *this; }
156 
158  { this->SetValues( this->RedChannel - Colour.RedChannel, this->GreenChannel - Colour.GreenChannel, this->BlueChannel - Colour.BlueChannel, this->AlphaChannel - Colour.AlphaChannel ); return *this; }
159 
161  { this->SetValues( this->RedChannel * Colour.RedChannel, this->GreenChannel * Colour.GreenChannel, this->BlueChannel * Colour.BlueChannel, this->AlphaChannel * Colour.AlphaChannel ); return *this; }
162 
164  { return ( Colour.RedChannel == this->RedChannel && Colour.GreenChannel == this->GreenChannel && Colour.BlueChannel == this->BlueChannel && Colour.AlphaChannel == this->AlphaChannel ); }
165 
167  { return ( Colour.RedChannel != this->RedChannel || Colour.GreenChannel != this->GreenChannel || Colour.BlueChannel != this->BlueChannel || Colour.AlphaChannel != this->AlphaChannel ); }
168 
169  void ColourValue::operator=(const ColourValue& OtherColour)
170  {
171  this->RedChannel = OtherColour.RedChannel;
172  this->GreenChannel = OtherColour.GreenChannel;
173  this->BlueChannel = OtherColour.BlueChannel;
174  this->AlphaChannel = OtherColour.AlphaChannel;
175  }
176 
177  ///////////////////////////////////////////////////////////////////////////////
178  // Prefab Colour fetchers
179 
181  { return ColourValue(0.0,0.0,0.0,0.0); }
182 
183  ///////////////////////////////////////////////////////////////////////////////
184  // X11 Colour Prefabs
185 
187  { return ColourValue(0.941176,0.972549,1.0,1.0); }
188 
190  { return ColourValue(0.980392,0.921568,0.843137,1.0); }
191 
193  { return ColourValue(0.0,1.0,1.0,1.0); }
194 
196  { return ColourValue(0.498039,1.0,0.831372,1.0); }
197 
199  { return ColourValue(0.941176,1.0,1.0,1.0); }
200 
202  { return ColourValue(0.960784,0.960784,0.862745,1.0); }
203 
205  { return ColourValue(1.0,0.894117,0.768627,1.0); }
206 
208  { return ColourValue(0.0,0.0,0.0,1.0); }
209 
211  { return ColourValue(1.0,0.921568,0.803921,1.0); }
212 
214  { return ColourValue(0.0,0.0,1.0,1.0); }
215 
217  { return ColourValue(0.541176,0.168627,0.886274,1.0); }
218 
220  { return ColourValue(0.647058,0.164705,0.164705,1.0); }
221 
223  { return ColourValue(0.870588,0.721568,0.529411,1.0); }
224 
226  { return ColourValue(0.372549,0.619607,0.627450,1.0); }
227 
229  { return ColourValue(0.498039,1.0,0.0,1.0); }
230 
232  { return ColourValue(0.823529,0.411764,0.117647,1.0); }
233 
235  { return ColourValue(1.0,0.498039,0.313725,1.0); }
236 
238  { return ColourValue(0.392116,0.584313,0.929411,1.0); }
239 
241  { return ColourValue(1.0,0.972549,0.862745,1.0); }
242 
244  { return ColourValue(0.862745,0.078431,0.235294,1.0); }
245 
247  { return ColourValue(0.0,1.0,1.0,1.0); }
248 
250  { return ColourValue(0.0,0.0,0.545098,1.0); }
251 
253  { return ColourValue(0.0,0.545098,0.545098,1.0); }
254 
256  { return ColourValue(0.721568,0.525490,0.043137,1.0); }
257 
259  { return ColourValue(0.662745,0.662745,0.662745,1.0); }
260 
262  { return ColourValue(0.0,0.392116,0.0,1.0); }
263 
265  { return ColourValue(0.741176,0.717647,0.419607,1.0); }
266 
268  { return ColourValue(0.545098,0.0,0.545098,1.0); }
269 
271  { return ColourValue(0.333333,0.419607,0.184313,1.0); }
272 
274  { return ColourValue(1.0,0.549019,0.0,1.0); }
275 
277  { return ColourValue(0.6,0.196078,0.8,1.0); }
278 
280  { return ColourValue(0.545098,0.0,0.0,1.0); }
281 
283  { return ColourValue(0.913725,0.588235,0.478431,1.0); }
284 
286  { return ColourValue(0.560784,0.737254,0.560784,1.0); }
287 
289  { return ColourValue(0.282352,0.239215,0.545098,1.0); }
290 
292  { return ColourValue(0.184313,0.309803,0.309803,1.0); }
293 
295  { return ColourValue(0.0,0.807843,0.819607,1.0); }
296 
298  { return ColourValue(0.580392,0.0,0.827450,1.0); }
299 
301  { return ColourValue(1.0,0.078431,0.576470,1.0); }
302 
304  { return ColourValue(0.0,0.749019,1.0,1.0); }
305 
307  { return ColourValue(0.411764,0.411764,0.411764,1.0); }
308 
310  { return ColourValue(0.117647,0.564705,1.0,1.0); }
311 
313  { return ColourValue(0.698039,0.133333,0.133333,1.0); }
314 
316  { return ColourValue(1.0,0.980392,0.941176,1.0); }
317 
319  { return ColourValue(0.133333,0.545098,0.133333,1.0); }
320 
322  { return ColourValue(1.0,0.0,1.0,1.0); }
323 
325  { return ColourValue(0.862745,0.862745,0.862745,1.0); }
326 
328  { return ColourValue(0.972549,0.972549,1.0,1.0); }
329 
331  { return ColourValue(1.0,0.843137,0.0,1.0); }
332 
334  { return ColourValue(0.854901,0.647058,0.125490,1.0); }
335 
337  { return ColourValue(0.501960,0.501960,0.501960,1.0); }
338 
340  { return ColourValue(0.0,0.501960,0.0,1.0); }
341 
343  { return ColourValue(0.678431,1.0,0.184313,1.0); }
344 
346  { return ColourValue(0.941176,1.0,0.941176,1.0); }
347 
349  { return ColourValue(1.0,0.411764,0.705882,1.0); }
350 
352  { return ColourValue(0.803921,0.360784,0.360784,1.0); }
353 
355  { return ColourValue(0.294117,0.0,0.509803,1.0); }
356 
358  { return ColourValue(1.0,1.0,0.941176,1.0); }
359 
361  { return ColourValue(0.941176,0.901960,0.549019,1.0); }
362 
364  { return ColourValue(0.901960,0.901960,0.980392,1.0); }
365 
367  { return ColourValue(1.0,0.941176,0.960784,1.0); }
368 
370  { return ColourValue(0.486274,0.988235,0.0,1.0); }
371 
373  { return ColourValue(1.0,0.980392,0.803921,1.0); }
374 
376  { return ColourValue(0.678431,0.847058,0.901960,1.0); }
377 
379  { return ColourValue(0.941176,0.501960,0.501960,1.0); }
380 
382  { return ColourValue(0.878431,1.0,1.0,1.0); }
383 
385  { return ColourValue(0.980392,0.980392,0.823529,1.0); }
386 
388  { return ColourValue(0.827450,0.827450,0.827450,1.0); }
389 
391  { return ColourValue(0.564705,0.933333,0.564705,1.0); }
392 
394  { return ColourValue(1.0,0.713725,0.756862,1.0); }
395 
397  { return ColourValue(1.0,0.627450,0.478431,1.0); }
398 
400  { return ColourValue(0.125490,0.698039,0.666666,1.0); }
401 
403  { return ColourValue(0.529411,0.807843,0.980392,1.0); }
404 
406  { return ColourValue(0.466666,0.533333,0.6,1.0); }
407 
409  { return ColourValue(0.690196,0.768627,0.870588,1.0); }
410 
412  { return ColourValue(1.0,1.0,0.878431,1.0); }
413 
415  { return ColourValue(0.0,1.0,0.0,1.0); }
416 
418  { return ColourValue(0.196078,0.803921,0.196078,1.0); }
419 
421  { return ColourValue(0.980392,0.941176,0.901960,1.0); }
422 
424  { return ColourValue(1.0,0.0,1.0,1.0); }
425 
427  { return ColourValue(0.501960,0.0,0.0,1.0); }
428 
430  { return ColourValue(0.4,0.803921,0.666666,1.0); }
431 
433  { return ColourValue(0.0,0.0,0.803921,1.0); }
434 
436  { return ColourValue(0.729411,0.333333,0.827450,1.0); }
437 
439  { return ColourValue(0.576470,0.439215,0.858823,1.0); }
440 
442  { return ColourValue(0.235294,0.701960,0.443137,1.0); }
443 
445  { return ColourValue(0.482352,0.407843,0.933333,1.0); }
446 
448  { return ColourValue(0.0,0.980392,0.603921,1.0); }
449 
451  { return ColourValue(0.282352,0.819607,0.8,1.0); }
452 
454  { return ColourValue(0.780392,0.082352,0.521568,1.0); }
455 
457  { return ColourValue(0.098039,0.098039,0.439215,1.0); }
458 
460  { return ColourValue(0.960784,1.0,0.980392,1.0); }
461 
463  { return ColourValue(1.0,0.894117,0.882352,1.0); }
464 
466  { return ColourValue(1.0,0.894117,0.709803,1.0); }
467 
469  { return ColourValue(1.0,0.870588,0.678431,1.0); }
470 
472  { return ColourValue(0.0,0.0,0.501960,1.0); }
473 
475  { return ColourValue(0.992156,0.960784,0.901960,1.0); }
476 
478  { return ColourValue(0.501960,0.501960,0.0,1.0); }
479 
481  { return ColourValue(0.419607,0.556862,0.137254,1.0); }
482 
484  { return ColourValue(1.0,0.647058,0.0,1.0); }
485 
487  { return ColourValue(1.0,0.270588,0.0,1.0); }
488 
490  { return ColourValue(0.854901,0.439215,0.839215,1.0); }
491 
493  { return ColourValue(0.933333,0.909803,0.666666,1.0); }
494 
496  { return ColourValue(0.596078,0.984313,0.596078,1.0); }
497 
499  { return ColourValue(0.686274,0.933333,0.933333,1.0); }
500 
502  { return ColourValue(0.858823,0.439215,0.576470,1.0); }
503 
505  { return ColourValue(1.0,0.937254,0.835294,1.0); }
506 
508  { return ColourValue(1.0,0.854901,0.725490,1.0); }
509 
511  { return ColourValue(0.803921,0.521568,0.247058,1.0); }
512 
514  { return ColourValue(1.0,0.752941,0.796078,1.0); }
515 
517  { return ColourValue(0.866666,0.627450,0.866666,1.0); }
518 
520  { return ColourValue(0.690196,0.878431,0.901960,1.0); }
521 
523  { return ColourValue(0.501960,0.0,0.501960,1.0); }
524 
526  { return ColourValue(1.0,0.0,0.0,1.0); }
527 
529  { return ColourValue(0.737254,0.560784,0.560784,1.0); }
530 
532  { return ColourValue(0.254901,0.411764,0.882352,1.0); }
533 
535  { return ColourValue(0.545098,0.270588,0.074509,1.0); }
536 
538  { return ColourValue(0.980392,0.501960,0.447058,1.0); }
539 
541  { return ColourValue(0.956862,0.643137,0.376470,1.0); }
542 
544  { return ColourValue(0.180392,0.545098,0.341176,1.0); }
545 
547  { return ColourValue(1.0,0.960784,0.933333,1.0); }
548 
550  { return ColourValue(0.627450,0.311568,0.176470,1.0); }
551 
553  { return ColourValue(0.752941,0.752941,0.752941,1.0); }
554 
556  { return ColourValue(0.529411,0.807843,0.921568,1.0); }
557 
559  { return ColourValue(0.415686,0.352941,0.803921,1.0); }
560 
562  { return ColourValue(0.439215,0.501960,0.564705,1.0); }
563 
565  { return ColourValue(1.0,0.980392,0.980392,1.0); }
566 
568  { return ColourValue(0.0,1.0,0.498039,1.0); }
569 
571  { return ColourValue(0.274509,0.509803,0.705882,1.0); }
572 
574  { return ColourValue(0.823529,0.705882,0.549019,1.0); }
575 
577  { return ColourValue(0.0,0.501960,0.501960,1.0); }
578 
580  { return ColourValue(0.847058,0.749019,0.847058,1.0); }
581 
583  { return ColourValue(1.0,0.388235,0.278431,1.0); }
584 
586  { return ColourValue(0.250980,0.878431,0.815686,1.0); }
587 
589  { return ColourValue(0.933333,0.509803,0.933333,1.0); }
590 
592  { return ColourValue(0.960784,0.870588,0.701960,1.0); }
593 
595  { return ColourValue(1.0,1.0,1.0,1.0); }
596 
598  { return ColourValue(0.960784,0.960784,0.960784,1.0); }
599 
601  { return ColourValue(1.0,1.0,0.0,1.0); }
602 
604  { return ColourValue(0.603921,0.803921,0.196078,1.0); }
605 
606  ///////////////////////////////////////////////////////////////////////////////
607  // Serialization
608 
609  void ColourValue::ProtoSerialize(XML::Node& CurrentRoot) const
610  {
612  VecNode.SetName(this->ColourValue::GetSerializableName());
613 
614  Mezzanine::XML::Attribute VersionAttr = VecNode.AppendAttribute("Version");
615  Mezzanine::XML::Attribute RAttr = VecNode.AppendAttribute("Red");
616  Mezzanine::XML::Attribute GAttr = VecNode.AppendAttribute("Green");
617  Mezzanine::XML::Attribute BAttr = VecNode.AppendAttribute("Blue");
618  Mezzanine::XML::Attribute AAttr = VecNode.AppendAttribute("Alpha");
619  if( VersionAttr && RAttr && BAttr && GAttr && AAttr)
620  {
621  if( VersionAttr.SetValue("1") && RAttr.SetValue(this->RedChannel) && BAttr.SetValue(this->BlueChannel) && GAttr.SetValue(this->GreenChannel) && AAttr.SetValue(this->AlphaChannel))
622  {
623  return;
624  }else{
625  SerializeError("Create XML Attribute Values", this->ColourValue::GetSerializableName(),true);
626  }
627  }else{
628  SerializeError("Create XML Attributes", this->ColourValue::GetSerializableName(),true);
629  }
630  }
631 
632  // DeSerializable
634  {
636  {
637  if(OneNode.GetAttribute("Version").AsInt() == 1)
638  {
639  this->RedChannel=OneNode.GetAttribute("Red").AsReal();
640  this->GreenChannel=OneNode.GetAttribute("Green").AsReal();
641  this->BlueChannel=OneNode.GetAttribute("Blue").AsReal();
642  this->AlphaChannel=OneNode.GetAttribute("Alpha").AsReal();
643  }else{
644  MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + (this->ColourValue::GetSerializableName()) + ": Not Version 1");
645  }
646  }else{
647  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_INVALID_EXCEPTION,"Attempting to deserialize a " + (this->ColourValue::GetSerializableName()) + ", found a " + OneNode.Name());
648  }
649  }
650 
652  { return String("ColourValue"); }
653 }//Mezzanine
654 
655 ///////////////////////////////////////////////////////////////////////////////
656 // Class External << Operators for streaming or assignment
657 std::ostream& operator << (std::ostream& stream, const Mezzanine::ColourValue& Ev)
658 {
659  Serialize(stream,Ev);
660  return stream;
661 }
662 
663 std::istream& MEZZ_LIB operator >> (std::istream& stream, Mezzanine::ColourValue& Ev)
664  { return DeSerialize(stream, Ev); }
665 
667  { Ev.ProtoDeSerialize(OneNode); }
668 
669 
670 #endif
static ColourValue Silver()
Creates a ColourValue representing the colour Silver.
std::ostream & operator<<(std::ostream &stream, const Mezzanine::LinearInterpolator< T > &Lint)
Used to Serialize an Mezzanine::LinearInterpolator to a human readable stream.
Definition: interpolator.h:433
static ColourValue MediumVioletRed()
Creates a ColourValue representing the colour MediumVioletRed.
static ColourValue NavajoWhite()
Creates a ColourValue representing the colour NavajoWhite.
static ColourValue DarkOrchid()
Creates a ColourValue representing the colour DarkOrchid.
static ColourValue DarkSeaGreen()
Creates a ColourValue representing the colour DarkSeaGreen.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
static ColourValue Gold()
Creates a ColourValue representing the colour Gold.
static ColourValue Khaki()
Creates a ColourValue representing the colour Khaki.
static ColourValue BlueViolet()
Creates a ColourValue representing the colour BlueViolet.
static ColourValue Yellow()
Creates a ColourValue representing the colour Yellow.
static ColourValue DarkGreen()
Creates a ColourValue representing the colour DarkGreen.
A light-weight handle for manipulating attributes in DOM tree.
Definition: attribute.h:74
static ColourValue PaleVioletRed()
Creates a ColourValue representing the colour PaleVioletRed.
static ColourValue Teal()
Creates a ColourValue representing the colour Teal.
static ColourValue LavenderBlush()
Creates a ColourValue representing the colour LavenderBlush.
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
static ColourValue MidnightBlue()
Creates a ColourValue representing the colour MidnightBlue.
Real GetAlphaChannel() const
Retrieve the Alpha color component.
static ColourValue Thistle()
Creates a ColourValue representing the colour Thistle.
static ColourValue PaleGreen()
Creates a ColourValue representing the colour PaleGreen.
static ColourValue BurlyWood()
Creates a ColourValue representing the colour BurlyWood.
static ColourValue LemonChiffon()
Creates a ColourValue representing the colour LemonChiffon.
static ColourValue MediumPurple()
Creates a ColourValue representing the colour MediumPurple.
static ColourValue PeachPuff()
Creates a ColourValue representing the colour PeachPuff.
static ColourValue DarkTurquoise()
Creates a ColourValue representing the colour DarkTurquoise.
static ColourValue Wheat()
Creates a ColourValue representing the colour Wheat.
static ColourValue Blue()
Creates a ColourValue representing the colour Blue.
static ColourValue MistyRose()
Creates a ColourValue representing the colour MistyRose.
Real GetGreenChannel() const
Retrieve the Green color component.
static ColourValue Moccasin()
Creates a ColourValue representing the colour Moccasin.
static ColourValue RosyBrown()
Creates a ColourValue representing the colour RosyBrown.
static ColourValue LightYellow()
Creates a ColourValue representing the colour LightYellow.
static ColourValue YellowGreen()
Creates a ColourValue representing the colour YellowGreen.
static ColourValue SpringGreen()
Creates a ColourValue representing the colour SpringGreen.
static ColourValue MediumOrchid()
Creates a ColourValue representing the colour MediumOrchid.
static ColourValue MediumSeaGreen()
Creates a ColourValue representing the colour MediumSeaGreen.
ColourValue & operator+=(const ColourValue &Colour)
Addition Operator.
static ColourValue LightPink()
Creates a ColourValue representing the colour LightPink.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
static ColourValue Tan()
Creates a ColourValue representing the colour Tan.
static ColourValue Maroon()
Creates a ColourValue representing the colour Maroon.
static ColourValue DarkCyan()
Creates a ColourValue representing the colour DarkCyan.
static ColourValue Pink()
Creates a ColourValue representing the colour Pink.
static ColourValue MediumSpringGreen()
Creates a ColourValue representing the colour MediumSpringGreen.
static ColourValue Aquamarine()
Creates a ColourValue representing the colour Aquamarine.
static ColourValue Coral()
Creates a ColourValue representing the colour Coral.
static ColourValue Turquoise()
Creates a ColourValue representing the colour Turquoise.
static ColourValue Aqua()
Creates a ColourValue representing the colour Aqua.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Definition: exception.h:3048
static ColourValue PapayaWhip()
Creates a ColourValue representing the colour PapayaWhip.
static ColourValue Cyan()
Creates a ColourValue representing the colour Cyan.
std::ostream & Serialize(std::ostream &Stream, const T &Converted, const String &Indent=String(""))
Convert any class that supports serialization or has a serializer to a string of chars in a stream...
static ColourValue MediumAquamarine()
Creates a ColourValue representing the colour MediumAquamarine.
static ColourValue FireBrick()
Creates a ColourValue representing the colour FireBrick.
static ColourValue Beige()
Creates a ColourValue representing the colour Beige.
static ColourValue DarkOliveGreen()
Creates a ColourValue representing the colour DarkOliveGreen.
static ColourValue GreenYellow()
Creates a ColourValue representing the colour GreenYellow.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Definition: exception.h:112
static ColourValue DodgerBlue()
Creates a ColourValue representing the colour DodgerBlue.
static ColourValue White()
Creates a ColourValue representing the colour White.
static ColourValue DeepPink()
Creates a ColourValue representing the colour DeepPink.
static ColourValue Sienna()
Creates a ColourValue representing the colour Sienna.
static ColourValue DarkGoldenRod()
Creates a ColourValue representing the colour DarkGoldenRod.
static ColourValue MediumTurquoise()
Creates a ColourValue representing the colour MediumTurquoise.
static ColourValue DimGray()
Creates a ColourValue representing the colour DimGray.
static ColourValue Black()
Creates a ColourValue representing the colour Black.
Boole operator==(const ColourValue &Colour) const
Equality Comparison Operator.
void SetBlueChannel(const Real Blue)
Set the Blue component of this color.
This is a simple class for holding 4 reals representing the colour any give object or lightsource can...
Definition: colourvalue.h:64
static ColourValue Lavender()
Creates a ColourValue representing the colour Lavender.
Real GetBlueChannel() const
Retrieve the Blue color component.
static ColourValue HoneyDew()
Creates a ColourValue representing the colour HoneyDew.
This implements the exception hiearchy for Mezzanine.
~ColourValue()
Class destructor.
Definition: colourvalue.cpp:80
static ColourValue LightGreen()
Creates a ColourValue representing the colour LightGreen.
static ColourValue Olive()
Creates a ColourValue representing the colour Olive.
static ColourValue IndianRed()
Creates a ColourValue representing the colour IndianRed.
ColourValue Average(const ColourValue &OtherColor) const
Get the color that is the average of this and another color.
static ColourValue Crimson()
Creates a ColourValue representing the colour Crimson.
static ColourValue LightGray()
Creates a ColourValue representing the colour LightGray.
static ColourValue HotPink()
Creates a ColourValue representing the colour HotPink.
static ColourValue Salmon()
Creates a ColourValue representing the colour Salmon.
static ColourValue SlateGray()
Creates a ColourValue representing the colour SlateGray.
static ColourValue SeaGreen()
Creates a ColourValue representing the colour SeaGreen.
Real GetRedChannel() const
Retrieve the Red color component.
ColourValue operator-(const ColourValue &Colour)
Subtraction Operator.
static ColourValue Green()
Creates a ColourValue representing the colour Green.
float Real
A Datatype used to represent a real floating point number.
Definition: datatypes.h:141
The interface for serialization.
static ColourValue MintCream()
Creates a ColourValue representing the colour MintCream.
static ColourValue LimeGreen()
Creates a ColourValue representing the colour LimeGreen.
static ColourValue Brown()
Creates a ColourValue representing the colour Brown.
static ColourValue Orange()
Creates a ColourValue representing the colour Orange.
ColourValue operator+(const ColourValue &Colour)
Addition Operator.
static ColourValue Magenta()
Creates a ColourValue representing the colour Magenta.
bool SetValue(const Char8 *rhs)
Set the value of this.
static ColourValue Bisque()
Creates a ColourValue representing the colour Bisque.
static ColourValue PowderBlue()
Creates a ColourValue representing the colour PowderBlue.
static ColourValue LightGoldenRodYellow()
Creates a ColourValue representing the colour LightGoldenRodYellow.
static ColourValue Indigo()
Creates a ColourValue representing the colour Indigo.
static ColourValue DarkSlateGray()
Creates a ColourValue representing the colour DarkSlateGray.
static ColourValue SandyBrown()
Creates a ColourValue representing the colour SandyBrown.
static ColourValue LightSteelBlue()
Creates a ColourValue representing the colour LightSteelBlue.
bool SetName(const Char8 *rhs)
Set the name of .
static ColourValue CornFlowerBlue()
Creates a ColourValue representing the colour CornFlowerBlue.
static ColourValue LawnGreen()
Creates a ColourValue representing the colour LawnGreen.
Real GreenChannel
Value from 0.0 to 1.0 representing the amount of green present in the colour. 1.0 if very green...
Definition: colourvalue.h:73
static ColourValue RoyalBlue()
Creates a ColourValue representing the colour RoyalBlue.
static ColourValue Gray()
Creates a ColourValue representing the colour Gray.
static ColourValue GoldenRod()
Creates a ColourValue representing the colour GoldenRod.
static ColourValue Gainsboro()
Creates a ColourValue representing the colour Gainsboro.
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
static ColourValue DarkOrange()
Creates a ColourValue representing the colour DarkOrange.
static ColourValue AliceBlue()
Creates a ColourValue representing the colour AliceBlue.
static ColourValue SkyBlue()
Creates a ColourValue representing the colour SkyBlue.
static ColourValue DarkGray()
Creates a ColourValue representing the colour DarkGray.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
static ColourValue MediumSlateBlue()
Creates a ColourValue representing the colour MediumSlateBlue.
static ColourValue LightSalmon()
Creates a ColourValue representing the colour LightSalmon.
static ColourValue Red()
Creates a ColourValue representing the colour Red.
static ColourValue SaddleBrown()
Creates a ColourValue representing the colour SaddleBrown.
static ColourValue Lime()
Creates a ColourValue representing the colour Lime.
static ColourValue DarkSalmon()
Creates a ColourValue representing the colour DarkSalmon.
static ColourValue Violet()
Creates a ColourValue representing the colour Violet.
static ColourValue Ivory()
Creates a ColourValue representing the colour Ivory.
Real AlphaChannel
Value from 0.0 to 1.0 representing the transparency of the colours. 1.0 is opaque and 0...
Definition: colourvalue.h:79
Boole operator!=(const ColourValue &Colour) const
Inequality Comparison Operator.
void operator=(const ColourValue &OtherColour)
Assignment operator.
static ColourValue WhiteSmoke()
Creates a ColourValue representing the colour WhiteSmoke.
static ColourValue SlateBlue()
Creates a ColourValue representing the colour SlateBlue.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
static ColourValue DarkBlue()
Creates a ColourValue representing the colour DarkBlue.
static ColourValue Fuchsia()
Creates a ColourValue representing the colour Fuchsia.
static ColourValue LightSeaGreen()
Creates a ColourValue representing the colour LightSeaGreen.
static ColourValue LightSkyBlue()
Creates a ColourValue representing the colour LightSkyBlue.
static ColourValue DarkSlateBlue()
Creates a ColourValue representing the colour DarkSlateBlue.
static ColourValue LightSlateGray()
Creates a ColourValue representing the colour LightSlateGray.
static ColourValue Snow()
Creates a ColourValue representing the colour Snow.
static ColourValue Azure()
Creates a ColourValue representing the colour Azure.
ColourValue & operator*=(const ColourValue &Colour)
Multiplication Operator.
static ColourValue PaleTurquoise()
Creates a ColourValue representing the colour PaleTurquoise.
static ColourValue DeepSkyBlue()
Creates a ColourValue representing the colour DeepSkyBlue.
std::istream & DeSerialize(std::istream &Stream, T &Converted)
Deserialize the next xml tag in the stream into a specific in memory class instance.
static ColourValue ForestGreen()
Creates a ColourValue representing the colour ForestGreen.
void SetValues(const Real Red, const Real Green, const Real Blue, const Real Alpha)
Sets each of the colour channels.
static ColourValue OliveDrab()
Creates a ColourValue representing the colour OliveDrab.
static ColourValue Peru()
Creates a ColourValue representing the colour Peru.
void SetRedChannel(const Real Red)
Set the Red component of this color.
Definition: colourvalue.cpp:99
static ColourValue Navy()
Creates a ColourValue representing the colour Navy.
static ColourValue CadetBlue()
Creates a ColourValue representing the colour CadetBlue.
static ColourValue OrangeRed()
Creates a ColourValue representing the colour OrangeRed.
static ColourValue Chocolate()
Creates a ColourValue representing the colour Chocolate.
static ColourValue DarkRed()
Creates a ColourValue representing the colour DarkRed.
static ColourValue LightCyan()
Creates a ColourValue representing the colour LightCyan.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
Thrown when the identity string wasn't valid at all.
Definition: exception.h:93
static ColourValue LightCoral()
Creates a ColourValue representing the colour LightCoral.
#define MEZZ_LIB
Some platforms require special decorations to denote what is exported/imported in a share library...
static ColourValue LightBlue()
Creates a ColourValue representing the colour LightBlue.
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
std::istream & operator>>(std::istream &stream, Mezzanine::LinearInterpolator< T > &Lint)
Used to de-serialize an Mezzanine::LinearInterpolator from a stream.
Definition: interpolator.h:448
Real BlueChannel
Value from 0.0 to 1.0 representing the amount of blue present in the colour. 1.0 if very blue...
Definition: colourvalue.h:76
static ColourValue AntiqueWhite()
Creates a ColourValue representing the colour AntiqueWhite.
static ColourValue CornSilk()
Creates a ColourValue representing the colour CornSilk.
static ColourValue OldLace()
Creates a ColourValue representing the colour OldLace.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
static ColourValue Linen()
Creates a ColourValue representing the colour Linen.
static ColourValue DarkKhaki()
Creates a ColourValue representing the colour DarkKhaki.
static ColourValue PaleGoldenRod()
Creates a ColourValue representing the colour PaleGoldenRod.
Real RedChannel
Value from 0.0 to 1.0 representing the amount of red present in the colour. 1.0 if very red...
Definition: colourvalue.h:70
static ColourValue Orchid()
Creates a ColourValue representing the colour Orchid.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
void SetAlphaChannel(const Real Alpha)
Set the Alpha component of this color.
Ogre::ColourValue GetOgreColourValue() const
Creates and returns an Ogre ColourValue class with values equal to this one.
Definition: colourvalue.cpp:86
static ColourValue Transparent()
Creates a ColourValue representing no colour.
static ColourValue Tomato()
Creates a ColourValue representing the colour Tomato.
ColourValue operator*(const Real Scalar)
Scalar Multiplication Operator.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
ColourValue(Real Red=1.0, Real Green=1.0, Real Blue=1.0, Real Alpha=1.0)
4 Reals constructor.
Definition: colourvalue.cpp:53
static ColourValue Chartreuse()
Creates a ColourValue representing the colour Chartreuse.
static ColourValue SeaShell()
Creates a ColourValue representing the colour SeaShell.
static ColourValue DarkMagenta()
Creates a ColourValue representing the colour DarkMagenta.
static ColourValue GhostWhite()
Creates a ColourValue representing the colour GhostWhite.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
ColourValue & operator-=(const ColourValue &Colour)
Subtraction Operator.
static ColourValue DarkViolet()
Creates a ColourValue representing the colour DarkViolet.
void SetGreenChannel(const Real Green)
Set the Green component of this color.
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
static ColourValue FloralWhite()
Creates a ColourValue representing the colour FloralWhite.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
static ColourValue SteelBlue()
Creates a ColourValue representing the colour SteelBlue.
static ColourValue Purple()
Creates a ColourValue representing the colour Purple.
static ColourValue Blanchedalmond()
Creates a ColourValue representing the colour Blanchedalmond.
static ColourValue MediumBlue()
Creates a ColourValue representing the colour MediumBlue.
static ColourValue Plum()
Creates a ColourValue representing the colour Plum.