Skip to content

Commit 636117d

Browse files
committed
color support
1 parent feec9a4 commit 636117d

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

src/engine/graphic/GRColor.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
GUIDO Library
3+
Copyright (C) 2025 D. Fober
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public
6+
License, v. 2.0. If a copy of the MPL was not distributed with this
7+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
*/
9+
10+
#include <iostream>
11+
using namespace std;
12+
13+
#include "ARColor.h"
14+
#include "GRColor.h"
15+
16+
//----------------------------------------------------------------------------------
17+
GRColor::GRColor( const ARColor* ar) : GRARNotationElement (ar) {
18+
fColor = ar->getColor();
19+
}
20+
21+
//----------------------------------------------------------------------------------
22+
void GRColor::OnDraw ( VGDevice & hdc ) const
23+
{
24+
hdc.SelectPenColor(fColor);
25+
hdc.SelectFillColor(fColor);
26+
hdc.SetFontColor(fColor);
27+
}

src/engine/graphic/GRColor.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
GUIDO Library
3+
Copyright (C) 2025 D. Fober
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public
6+
License, v. 2.0. If a copy of the MPL was not distributed with this
7+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
*/
9+
10+
#pragma once
11+
12+
#include "GRARNotationElement.h"
13+
#include "VGDevice.h"
14+
15+
class ARColor;
16+
17+
/** \brief Voice color management
18+
*/
19+
20+
class GRColor : public GRARNotationElement
21+
{
22+
VGColor fColor;
23+
24+
public:
25+
GRColor(const ARColor* color);
26+
virtual ~GRColor() {}
27+
28+
virtual void OnDraw( VGDevice & hdc ) const;
29+
};
30+
31+

0 commit comments

Comments
 (0)