LibrePCB Developers Documentation
PcbColor Class Referencefinal

Predefined colors relevant for PCB fabrication. More...

#include <pcbcolor.h>

+ Collaboration diagram for PcbColor:

Public Types

enum class  Flag : quint32
 

Public Member Functions

 PcbColor ()=delete
 
 PcbColor (const PcbColor &other) noexcept
 
 ~PcbColor () noexcept
 
const QString & getId () const noexcept
 Get the identifier used for serialization. More...
 
const QString & getNameTr () const noexcept
 Get the name of the color (human readable and translated) More...
 
const QColor & toSolderResistColor () const noexcept
 Get the actual color for solder resist rendering. More...
 
const QColor & toSilkscreenColor () const noexcept
 Get the actual color for silkscreen rendering. More...
 
bool isAvailableForSolderResist () const noexcept
 Check if this color is available for solder resist. More...
 
bool isAvailableForSilkscreen () const noexcept
 Check if this color is available for silkscreen. More...
 
PcbColoroperator= (const PcbColor &rhs) noexcept=delete
 
bool operator== (const PcbColor &rhs) const noexcept
 
bool operator!= (const PcbColor &rhs) const noexcept
 

Static Public Member Functions

static const PcbColorblack () noexcept
 
static const PcbColorblackMatte () noexcept
 
static const PcbColorblue () noexcept
 
static const PcbColorclear () noexcept
 
static const PcbColorgreen () noexcept
 
static const PcbColorgreenMatte () noexcept
 
static const PcbColorpurple () noexcept
 
static const PcbColorred () noexcept
 
static const PcbColorwhite () noexcept
 
static const PcbColoryellow () noexcept
 
static const PcbColorother () noexcept
 
static const QVector< const PcbColor * > & all () noexcept
 Get a list of all available colors. More...
 
static const PcbColorget (const QString &id)
 Get a color by its identifier. More...
 

Private Member Functions

 PcbColor (const QString &id, const QString &nameTr, Flags flags, const QColor &solderResistColor, const QColor &silkscreenColor) noexcept
 

Private Attributes

const QString mId
 
const QString mNameTr
 
const Flags mFlags
 
const QColor mSolderResistColor
 
const QColor mSilkscreenColor
 

Detailed Description

Predefined colors relevant for PCB fabrication.

Member Enumeration Documentation

◆ Flag

enum class Flag : quint32
strong
Enumerator
SolderResist 

Color available for solder resist.

Silkscreen 

Color available for silkscreen.

Constructor & Destructor Documentation

◆ PcbColor() [1/3]

PcbColor ( )
delete
+ Here is the caller graph for this function:

◆ PcbColor() [2/3]

PcbColor ( const PcbColor other)
noexcept

◆ ~PcbColor()

~PcbColor ( )
noexcept

◆ PcbColor() [3/3]

PcbColor ( const QString &  id,
const QString &  nameTr,
Flags  flags,
const QColor &  solderResistColor,
const QColor &  silkscreenColor 
)
privatenoexcept

Member Function Documentation

◆ getId()

const QString & getId ( ) const
inlinenoexcept

Get the identifier used for serialization.

Returns
Identifier string (lower_snake_case)
+ Here is the caller graph for this function:

◆ getNameTr()

const QString & getNameTr ( ) const
inlinenoexcept

Get the name of the color (human readable and translated)

Returns
The name of the color
+ Here is the caller graph for this function:

◆ toSolderResistColor()

const QColor & toSolderResistColor ( ) const
noexcept

Get the actual color for solder resist rendering.

Returns
A QColor object representing this color, or a default color if this color does not represent a valid solder resist color
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toSilkscreenColor()

const QColor & toSilkscreenColor ( ) const
noexcept

Get the actual color for silkscreen rendering.

Returns
A QColor object representing this color, or a default color if this color does not represent a valid silkscreen color
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAvailableForSolderResist()

bool isAvailableForSolderResist ( ) const
inlinenoexcept

Check if this color is available for solder resist.

Returns
Whether this color is available or not
+ Here is the caller graph for this function:

◆ isAvailableForSilkscreen()

bool isAvailableForSilkscreen ( ) const
inlinenoexcept

Check if this color is available for silkscreen.

Returns
Whether this color is available or not
+ Here is the caller graph for this function:

◆ operator=()

PcbColor & operator= ( const PcbColor rhs)
deletenoexcept

◆ operator==()

bool operator== ( const PcbColor rhs) const
inlinenoexcept

◆ operator!=()

bool operator!= ( const PcbColor rhs) const
inlinenoexcept

◆ black()

const PcbColor & black ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ blackMatte()

const PcbColor & blackMatte ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ blue()

const PcbColor & blue ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ clear()

const PcbColor & clear ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ green()

const PcbColor & green ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ greenMatte()

const PcbColor & greenMatte ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ purple()

const PcbColor & purple ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ red()

const PcbColor & red ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ white()

const PcbColor & white ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ yellow()

const PcbColor & yellow ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ other()

const PcbColor & other ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ all()

const QVector< const PcbColor * > & all ( )
staticnoexcept

Get a list of all available colors.

Returns
A list of all colors
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

const PcbColor & get ( const QString &  id)
static

Get a color by its identifier.

Parameters
idColor identifier.
Returns
PcbColor object.
Exceptions
Exceptionif the color was not found.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mId

const QString mId
private

◆ mNameTr

const QString mNameTr
private

◆ mFlags

const Flags mFlags
private

◆ mSolderResistColor

const QColor mSolderResistColor
private

◆ mSilkscreenColor

const QColor mSilkscreenColor
private

The documentation for this class was generated from the following files: