Skip to content

Commit

Permalink
Merge pull request #47 from tue-alga/add-color-constructor
Browse files Browse the repository at this point in the history
Add a constructor to Color
  • Loading branch information
Willem3141 authored Oct 2, 2024
2 parents 0f699d5 + b2b9085 commit 30ddc8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cartocrow/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Created by tvl (t.vanlankveld@esciencecenter.nl) on 05-12-2019

namespace cartocrow {

Color::Color() : r(0), g(0), b(0) {}
Color::Color(int r, int g, int b) : r(r), g(g), b(b) {}

Number<Inexact> wrapAngle(Number<Inexact> alpha, Number<Inexact> beta) {
return wrap<Inexact>(alpha, beta, beta + M_2xPI);
}
Expand Down
4 changes: 4 additions & 0 deletions cartocrow/core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ struct Color {
int g;
/// Blue component (integer 0-255).
int b;
/// Constructs the color black.
Color();
/// Constructs a color.
Color(int r, int g, int b);
};

/// Wraps the given number \f$n\f$ to the interval \f$[a, b)\f$.
Expand Down

0 comments on commit 30ddc8f

Please sign in to comment.