bWidgets
Core widget toolkit designed for Blender
bWidgets::bwGradient Class Reference

Simple class for calculating colors for gradient fills. More...

#include <bwGradient.h>

+ Collaboration diagram for bWidgets::bwGradient:

Public Types

enum class  Direction { TOP_BOTTOM , LEFT_RIGHT }
 

Public Member Functions

 bwGradient ()=default
 
 bwGradient (const bwColor &base_color, float shade_begin, float shade_end, Direction direction=Direction::TOP_BOTTOM)
 
auto calcPointColor (const class bwPoint &point, const bwRectanglePixel &bounding_box) const -> bwColor
 

Public Attributes

bwColor begin
 
bwColor end
 
Direction direction {Direction::TOP_BOTTOM}
 

Detailed Description

Simple class for calculating colors for gradient fills.

The implementation is currently pretty simple and limited, it's however all we need for now. More features like unlimited stops at custom positions could be added if needed.

Member Enumeration Documentation

◆ Direction

Enumerator
TOP_BOTTOM 
LEFT_RIGHT 

Constructor & Destructor Documentation

◆ bwGradient() [1/2]

bWidgets::bwGradient::bwGradient ( )
default

◆ bwGradient() [2/2]

bWidgets::bwGradient::bwGradient ( const bwColor base_color,
float  shade_begin,
float  shade_end,
Direction  direction = Direction::TOP_BOTTOM 
)
explicit

Member Function Documentation

◆ calcPointColor()

auto bWidgets::bwGradient::calcPointColor ( const class bwPoint point,
const bwRectanglePixel bounding_box 
) const -> bwColor

Member Data Documentation

◆ begin

bwColor bWidgets::bwGradient::begin

◆ direction

Direction bWidgets::bwGradient::direction {Direction::TOP_BOTTOM}

◆ end

bwColor bWidgets::bwGradient::end

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