KiCad PCB EDA Suite
Loading...
Searching...
No Matches
color4d_variant.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef KICAD_COLOR4D_VARIANT_H
21#define KICAD_COLOR4D_VARIANT_H
22
23#include <gal/color4d.h>
24#include <wx/variant.h>
25
26class COLOR4D_VARIANT_DATA : public wxVariantData
27{
28public:
30
31 COLOR4D_VARIANT_DATA( const wxString& aColorStr );
32
33 COLOR4D_VARIANT_DATA( const KIGFX::COLOR4D& aColor );
34
35 bool Eq( wxVariantData& aOther ) const override;
36
37 wxString GetType() const override { return wxT( "COLOR4D" ); }
38
39 bool Read( wxString& aString ) override;
40
41 bool Write( wxString& aString ) const override;
42
43 bool GetAsAny( wxAny* aAny ) const override;
44
45 static wxVariantData* VariantDataFactory( const wxAny& aAny );
46
47 const KIGFX::COLOR4D& Color() { return m_color; }
48
49 void SetColor( const KIGFX::COLOR4D& aColor ) { m_color = aColor; }
50
51protected:
53};
54
55#endif //KICAD_COLOR4D_VARIANT_H
bool Write(wxString &aString) const override
bool GetAsAny(wxAny *aAny) const override
wxString GetType() const override
KIGFX::COLOR4D m_color
void SetColor(const KIGFX::COLOR4D &aColor)
const KIGFX::COLOR4D & Color()
static wxVariantData * VariantDataFactory(const wxAny &aAny)
bool Read(wxString &aString) override
bool Eq(wxVariantData &aOther) const override
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104