Krita Source Code Documentation
Loading...
Searching...
No Matches
KoGradientStop Struct Reference

#include <KoStopGradient.h>

+ Inheritance diagram for KoGradientStop:

Public Member Functions

 KoGradientStop (qreal _position=0.0, KoColor _color=KoColor(), KoGradientStopType _type=COLORSTOP)
 
bool operator== (const KoGradientStop &other) const
 
QString typeString () const
 

Static Public Member Functions

static KoGradientStopType typeFromString (QString typestring)
 

Public Attributes

KoColor color
 
qreal position
 
KoGradientStopType type
 

Detailed Description

Definition at line 26 of file KoStopGradient.h.

Constructor & Destructor Documentation

◆ KoGradientStop()

KoGradientStop::KoGradientStop ( qreal _position = 0.0,
KoColor _color = KoColor(),
KoGradientStopType _type = COLORSTOP )
inline

Definition at line 32 of file KoStopGradient.h.

33 {
34 type = _type;
35 color = _color;
36 position = _position;
37 }
KoGradientStopType type

References color, position, and type.

Member Function Documentation

◆ operator==()

bool KoGradientStop::operator== ( const KoGradientStop & other) const
inline

Definition at line 39 of file KoStopGradient.h.

40 {
41 return this->type == other.type && this->color == other.color && this->position == other.position;
42 }

References color, position, and type.

◆ typeFromString()

static KoGradientStopType KoGradientStop::typeFromString ( QString typestring)
inlinestatic

Definition at line 60 of file KoStopGradient.h.

60 {
61 if (typestring == "foreground-stop") {
62 return FOREGROUNDSTOP;
63 } else if (typestring == "background-stop") {
64 return BACKGROUNDSTOP;
65 } else {
66 return COLORSTOP;
67 }
68 }
@ FOREGROUNDSTOP
@ BACKGROUNDSTOP
@ COLORSTOP

References BACKGROUNDSTOP, COLORSTOP, and FOREGROUNDSTOP.

◆ typeString()

QString KoGradientStop::typeString ( ) const
inline

Definition at line 46 of file KoStopGradient.h.

47 {
48 switch (type) {
49 case COLORSTOP:
50 return "color-stop";
51 case FOREGROUNDSTOP:
52 return "foreground-stop";
53 case BACKGROUNDSTOP:
54 return "background-stop";
55 default:
56 return "color-stop";
57 }
58 }

References BACKGROUNDSTOP, COLORSTOP, FOREGROUNDSTOP, and type.

Member Data Documentation

◆ color

KoColor KoGradientStop::color

Definition at line 29 of file KoStopGradient.h.

◆ position

qreal KoGradientStop::position

Definition at line 30 of file KoStopGradient.h.

◆ type

KoGradientStopType KoGradientStop::type

Definition at line 28 of file KoStopGradient.h.


The documentation for this struct was generated from the following file: