Color class (#5361)

* Color class

* Switch to list initialization
This commit is contained in:
Young Hahn
2016-06-15 11:38:22 -04:00
committed by GitHub
parent fe64238b4c
commit 24b66bc8cd
40 changed files with 105 additions and 62 deletions

View File

@@ -8,6 +8,7 @@
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/util/io.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/util/color.hpp>
using namespace mbgl;
@@ -48,7 +49,7 @@ TEST(Annotations, LineAnnotation) {
LineString<double> line = {{ { 0, 0 }, { 45, 45 }, { 30, 0 } }};
LineAnnotation annotation { line };
annotation.color = {{ 255, 0, 0, 1 }};
annotation.color = { 255, 0, 0, 1 };
annotation.width = 5;
test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
@@ -61,7 +62,7 @@ TEST(Annotations, FillAnnotation) {
Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }};
FillAnnotation annotation { polygon };
annotation.color = {{ 255, 0, 0, 1 }};
annotation.color = { 255, 0, 0, 1 };
test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
test.map.addAnnotation(annotation);
@@ -99,7 +100,7 @@ TEST(Annotations, NonImmediateAdd) {
Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }};
FillAnnotation annotation { polygon };
annotation.color = {{ 255, 0, 0, 1 }};
annotation.color = { 255, 0, 0, 1 };
test.map.addAnnotation(annotation);
test.checkRendering("non_immediate_add");
@@ -153,7 +154,7 @@ TEST(Annotations, RemoveShape) {
LineString<double> line = {{ { 0, 0 }, { 45, 45 } }};
LineAnnotation annotation { line };
annotation.color = {{ 255, 0, 0, 1 }};
annotation.color = { 255, 0, 0, 1 };
annotation.width = 5;
test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));