2013-11-13 19:07:35 +00:00
|
|
|
#include "Color.inline.cpp"
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
#include "PackStream.h"
|
|
|
|
|
|
|
|
const Color paysages::basics::COLOR_TRANSPARENT = {0.0, 0.0, 0.0, 0.0};
|
|
|
|
const Color paysages::basics::COLOR_BLACK = {0.0, 0.0, 0.0, 1.0};
|
|
|
|
const Color paysages::basics::COLOR_RED = {1.0, 0.0, 0.0, 1.0};
|
|
|
|
const Color paysages::basics::COLOR_GREEN = {0.0, 1.0, 0.0, 1.0};
|
|
|
|
const Color paysages::basics::COLOR_BLUE = {0.0, 0.0, 1.0, 1.0};
|
|
|
|
const Color paysages::basics::COLOR_WHITE = {1.0, 1.0, 1.0, 1.0};
|
|
|
|
const Color paysages::basics::COLOR_GREY = {0.5, 0.5, 0.5, 1.0};
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
void Color::save(PackStream *stream) const {
|
2013-11-13 19:07:35 +00:00
|
|
|
stream->write(&r);
|
|
|
|
stream->write(&g);
|
|
|
|
stream->write(&b);
|
|
|
|
stream->write(&a);
|
|
|
|
}
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
void Color::load(PackStream *stream) {
|
2013-11-13 19:07:35 +00:00
|
|
|
stream->read(&r);
|
|
|
|
stream->read(&g);
|
|
|
|
stream->read(&b);
|
|
|
|
stream->read(&a);
|
|
|
|
}
|