File indexing completed on 2024-04-21 03:50:55

0001 /*************************************************************************
0002  *  Copyright (C) 2020 by Caio Jordão Carvalho <caiojcarvalho@gmail.com> *
0003  *                                                                       *
0004  *  This program is free software; you can redistribute it and/or        *
0005  *  modify it under the terms of the GNU General Public License as       *
0006  *  published by the Free Software Foundation; either version 3 of       *
0007  *  the License, or (at your option) any later version.                  *
0008  *                                                                       *
0009  *  This program is distributed in the hope that it will be useful,      *
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0012  *  GNU General Public License for more details.                         *
0013  *                                                                       *
0014  *  You should have received a copy of the GNU General Public License    *
0015  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.*
0016  *************************************************************************/
0017 
0018 #include "core/markedclass.h"
0019 
0020 #include <QtGlobal>
0021 #include <QRandomGenerator>
0022 
0023 MarkedClass::MarkedClass(QString name) :
0024     m_name(name)
0025 {
0026     auto rand = QRandomGenerator().global();
0027 
0028     m_color = QColor(rand->bounded(0, 256), rand->bounded(0, 256), rand->bounded(0, 256));
0029 }
0030 
0031 MarkedClass::MarkedClass(QString name, QColor color) :
0032     m_name(name),
0033     m_color(color)
0034 {
0035 }