1 // Copyright (C) 2015-2023 CEA, EDF, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #include "OCCViewer.h"
24 \brief Convert QColor object to Quantity_Color object.
25 \param c color object in Qt format
26 \return color object in OCC format
28 Quantity_Color OCCViewer::color( const QColor& c )
30 Quantity_Color aColor;
32 aColor = Quantity_Color( c.red() / 255., c.green() / 255.,
33 c.blue() / 255., Quantity_TOC_RGB );
38 \brief Convert Quantity_Color object to QColor object.
39 \param c color object in OCC format
40 \return color object in Qt format
42 QColor OCCViewer::color( const Quantity_Color& c )
44 return QColor ( int( c.Red() * 255 ),
45 int( c.Green() * 255 ),
46 int( c.Blue() * 255 ) );