1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Updated Brushes (markdown)

Robert Beekman 2017-01-01 13:31:33 +01:00
parent fdc28f0c28
commit 3610908f19

@ -142,4 +142,26 @@ local spotlight = Brushes.GetRadialGradientBrush(colors, 0.5, 0.5, 0, 0);
Drawing the first brush would look like this:
![RadialGradientBrush](http://i.imgur.com/GXkooQt.png "RadialGradientBrush")
Drawing the second brush would look like this:
![RadialGradientBrush](http://i.imgur.com/PpMjgnq.png "RadialGradientBrush")
![RadialGradientBrush](http://i.imgur.com/PpMjgnq.png "RadialGradientBrush")
---
### GetRelativeColor
Returns the color at the given position in a gradient.
#### Syntax:
```lua
color GetRelativeColor(table gradientColors, double position);
```
##### Required arguments
- **gradientColors:** A table using colors as keys and doubles as offsets
- **position:** A position between 0 and 1.
#### Example:
```lua
-- Create a table and add keys to it (the color) and values (the offset).
local colors = {};
colors[Brushes.GetColor(255, 255, 0, 0)] = 0; -- red
colors[Brushes.GetColor(255, 255, 255, 0)] = 1; -- yellow
-- Get the color that is in the middle of the gradient, between red and yellow
local orange = Brushes.GetRelativeColor(colors, 0.5);
```