doodle
0.2
Intended to support teaching C++, doodle is a simple library that helps make a window and makes it easy to do some drawing.
|
Classes | |
class | doodle::Color |
Color is a color represented with four unsigned bytes. More... | |
class | doodle::HexColor |
This is a helper class to easily represent an RGBA color as an int with hexadecimal notation. More... | |
Functions | |
void | doodle::clear_background () noexcept |
Clear the background to black. More... | |
void | doodle::clear_background (HexColor color) noexcept |
Clear the background to the specified HexColor. More... | |
void | doodle::clear_background (Color color) noexcept |
Clear the background to the specified Color. More... | |
void | doodle::clear_background (double grey, double alpha=255) noexcept |
Clear the background to a grey color. More... | |
void | doodle::clear_background (double red, double green, double blue, double alpha=255) noexcept |
Clear the background to a specified RGBA color. More... | |
void | doodle::set_fill_color (HexColor color) noexcept |
Sets the color used to fill shapes to the specified HexColor. More... | |
void | doodle::set_fill_color (Color color) noexcept |
Sets the color used to fill shapes to the specified Color. More... | |
void | doodle::set_fill_color (double grey, double alpha=255) noexcept |
Sets the color used to fill shapes to a grey. More... | |
void | doodle::set_fill_color (double red, double green, double blue, double alpha=255) noexcept |
Sets the color used to fill shapes to the specified RGBA values. More... | |
void | doodle::no_fill () noexcept |
Disables filling geometry. More... | |
void | doodle::set_outline_color (HexColor color) noexcept |
Set the outline and lines of shapes to the specified HexColor. More... | |
void | doodle::set_outline_color (Color color) noexcept |
Set the outline and lines of shapes to the specified Color. More... | |
void | doodle::set_outline_color (double grey, double alpha=255) noexcept |
Set the outline and lines of shapes to a grey color. More... | |
void | doodle::set_outline_color (double red, double green, double blue, double alpha=255) noexcept |
Set the outline and lines of shapes to an RGBA color. More... | |
void | doodle::no_outline () |
Disables drawing the outline. More... | |
|
noexcept |
Clear the background to black.
The clear_background() function sets the color used for the background of the canvas. The default background is black. This function is typically used within draw loop to clear the display window at the beginning of each frame, but it can be used outside the loop to set the background on the first frame of animation or if the background need only be set once.
|
noexcept |
Clear the background to the specified Color.
The clear_background() function sets the color used for the background of the canvas. The default background is black. This function is typically used within draw loop to clear the display window at the beginning of each frame, but it can be used outside the loop to set the background on the first frame of animation or if the background need only be set once.
color | Color to clear the screen to |
|
noexcept |
Clear the background to a grey color.
The clear_background() function sets the color used for the background of the canvas. The default background is black. This function is typically used within draw loop to clear the display window at the beginning of each frame, but it can be used outside the loop to set the background on the first frame of animation or if the background need only be set once.
grey | specifies a value between white and black |
alpha | optional opacity value of the background between 0-255. The default value is 255. |
|
noexcept |
Clear the background to a specified RGBA color.
The clear_background() function sets the color used for the background of the canvas. The default background is black. This function is typically used within draw loop to clear the display window at the beginning of each frame, but it can be used outside the loop to set the background on the first frame of animation or if the background need only be set once.
red | value between 0-255 |
green | value between 0-255 |
blue | value between 0-255 |
alpha | optional opacity value of the background between 0-255. The default value is 255. |
|
noexcept |
Clear the background to the specified HexColor.
The clear_background() function sets the color used for the background of the canvas. The default background is black. This function is typically used within draw loop to clear the display window at the beginning of each frame, but it can be used outside the loop to set the background on the first frame of animation or if the background need only be set once.
color | HexColor to clear the screen to. |
|
noexcept |
Disables filling geometry.
If both no_outline() and no_fill() are called, nothing will be drawn to the screen.
void doodle::no_outline | ( | ) |
Disables drawing the outline.
If both no_outline() and no_fill() are called, nothing will be drawn to the screen.
|
noexcept |
Sets the color used to fill shapes to the specified Color.
For example, if you run set_fill_color(Color{0,255,0,64}), all shapes drawn after the fill command will be filled with a translucent green color. The color space is RGBA, with each value in the range from 0 to 255.
color | Color to apply |
|
noexcept |
Sets the color used to fill shapes to a grey.
For example, if you run set_fill_color(51), all shapes drawn after the fill command will be filled with the color dark dark grey. The color space is RGBA, with each value in the range from 0 to 255.
grey | specifies a value between white and black |
alpha | optional opacity value of the background between 0-255. The default value is 255. |
|
noexcept |
Sets the color used to fill shapes to the specified RGBA values.
For example, if you run set_fill_color(138,43,226), all shapes drawn after the fill command will be filled with the color purple. The color space is RGBA, with each value in the range from 0 to 255.
red | value between 0-255 |
green | value between 0-255 |
blue | value between 0-255 |
alpha | optional opacity value of the background between 0-255. The default value is 255. |
|
noexcept |
Sets the color used to fill shapes to the specified HexColor.
For example, if you run set_fill_color(HexColor{0xffaaeeff}), all shapes drawn after the fill command will be filled with the color pink. The color space is RGBA, with each value in the range from 0 to 255.
color | HexColor to apply |
|
noexcept |
Set the outline and lines of shapes to the specified Color.
Sets the color used to draw lines and borders around shapes. The color space is RGBA, with each value in the range from 0 to 255.
color | Color to apply |
|
noexcept |
Set the outline and lines of shapes to a grey color.
Sets the color used to draw lines and borders around shapes. The color space is RGBA, with each value in the range from 0 to 255.
grey | specifies a value between white and black |
alpha | optional opacity value of the background between 0-255. The default value is 255. |
|
noexcept |
Set the outline and lines of shapes to an RGBA color.
Sets the color used to draw lines and borders around shapes. The color space is RGBA, with each value in the range from 0 to 255.
red | value between 0-255 |
green | value between 0-255 |
blue | value between 0-255 |
alpha | optional opacity value of the background between 0-255. The default value is 255. |
|
noexcept |
Set the outline and lines of shapes to the specified HexColor.
Sets the color used to draw lines and borders around shapes. The color space is RGBA, with each value in the range from 0 to 255.
color | HexColor to apply |