|
QCAD
Open Source 2D CAD
|
Color. More...
#include <RColor.h>
Public Types | |
| enum | Mode { ByLayer , ByBlock , Fixed } |
Public Member Functions | |
| int | getColorIndex () const |
| int | getCustomColorCode () const |
| unsigned long long | getHash () const |
| QString | getName () const |
| bool | isByBlock () const |
| bool | isByLayer () const |
| bool | isFixed () const |
| bool | isValid () const |
| bool | operator!= (const RColor &color) const |
| bool | operator< (const RColor &color) const |
| bool | operator== (const RColor &color) const |
| RColor () | |
| Constructs an invalid color with the fixed RGB value (0, 0, 0). | |
| RColor (const QColor &color, RColor::Mode mode=RColor::Fixed) | |
| RColor (const QString &name, RColor::Mode mode=RColor::Fixed) | |
| RColor (int r, int g, int b, int a=255, RColor::Mode mode=RColor::Fixed) | |
| RColor (Qt::GlobalColor color, RColor::Mode mode=RColor::Fixed) | |
| RColor (RColor::Mode mode) | |
| void | setCompat (const QColor &col) |
| Initializes this color based on the given compatibility color. | |
| QColor | toCompat () const |
Static Public Member Functions | |
| static void | addColor (const QString &cn, const RColor &c) |
| static RColor | createFromCadCustom (const QString &code) |
| static RColor | createFromCadCustom (int code) |
| Creates a color from the given CAD code (RGB encoded int). | |
| static RColor | createFromCadIndex (const QString &code) |
| static RColor | createFromCadIndex (int code) |
| Creates a color from the given CAD code (index 0...256). | |
| static RColor | createFromName (const QString &name) |
| static QList< RColor > | getColorList (bool onlyFixed=false) |
| static RColor | getFaded (const RColor &color, const QColor &bgColor, double factor=1) |
| static RColor | getHighlighted (const RColor &color, const QColor &bgColor, int minDist=75) |
| static QIcon | getIcon (const RColor &color, const QSize &size=RDEFAULT_QSIZE_ICON) |
| static QList< QPair< QString, RColor > > | getList (bool onlyFixed=false) |
| static QStringList | getNameList (bool onlyFixed=false) |
| static void | reinit () |
| static void | removeColor (const QString &cn) |
Static Public Attributes | |
| static QColor | CompatByBlock = QColor(2,2,2) |
| static QColor | CompatByLayer = QColor(1,1,1) |
| Copyright (c) 2011-2018 by Andrew Mustun. | |
Private Member Functions | |
| Q_DECLARE_TR_FUNCTIONS (RColor) | |
Static Private Member Functions | |
| static void | init () |
| static void | init (const QString &cn, const RColor &c) |
Private Attributes | |
| Mode | mode |
Static Private Attributes | |
| static const double | cadColors [][3] |
| Copyright (c) 2011-2018 by Andrew Mustun. | |
| static QMap< QPair< RColor, QPair< int, int > >, QIcon > | iconMap |
| static bool | isInitialized = false |
| static QList< QPair< QString, RColor > > | list |
Friends | |
| QCADCORE_EXPORT QDataStream & | operator<< (QDataStream &stream, const RColor &color) |
| Serializes the given RColor object. | |
| QCADCORE_EXPORT QDataStream & | operator>> (QDataStream &stream, RColor &color) |
| Deserializes the given RColor object. | |
Color.
Fixed RGBA or ByLayer or ByBlock.
| enum RColor::Mode |
| RColor::RColor | ( | ) |
Constructs an invalid color with the fixed RGB value (0, 0, 0).
| RColor::RColor | ( | int | r, |
| int | g, | ||
| int | b, | ||
| int | a = 255, | ||
| RColor::Mode | mode = RColor::Fixed ) |
| RColor::RColor | ( | RColor::Mode | mode | ) |
|
explicit |
| RColor::RColor | ( | Qt::GlobalColor | color, |
| RColor::Mode | mode = RColor::Fixed ) |
| RColor::RColor | ( | const QColor & | color, |
| RColor::Mode | mode = RColor::Fixed ) |
|
static |
Creates a color from the given CAD code (RGB encoded int).
|
static |
Creates a color from the given CAD code (index 0...256).
| int RColor::getColorIndex | ( | ) | const |
| int RColor::getCustomColorCode | ( | ) | const |
| unsigned long long RColor::getHash | ( | ) | const |
|
static |
|
static |
| onlyFixed | Only fixed colors, not ByLayer, ByBlock, ... |
| QString RColor::getName | ( | ) | const |
|
static |
|
staticprivate |
| bool RColor::isByBlock | ( | ) | const |
| bool RColor::isByLayer | ( | ) | const |
| bool RColor::isFixed | ( | ) | const |
| bool RColor::isValid | ( | ) | const |
|
private |
|
inlinestatic |
|
static |
| void RColor::setCompat | ( | const QColor & | col | ) |
Initializes this color based on the given compatibility color.
| QColor RColor::toCompat | ( | ) | const |
|
friend |
|
friend |
Deserializes the given RColor object.
|
staticprivate |
Copyright (c) 2011-2018 by Andrew Mustun.
All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.
|
static |
|
static |
Copyright (c) 2011-2018 by Andrew Mustun.
All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.
|
staticprivate |
|
staticprivate |
|
private |