mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Updated Brushes (markdown)
parent
fdc28f0c28
commit
3610908f19
24
Brushes.md
24
Brushes.md
@ -142,4 +142,26 @@ local spotlight = Brushes.GetRadialGradientBrush(colors, 0.5, 0.5, 0, 0);
|
||||
Drawing the first brush would look like this:
|
||||

|
||||
Drawing the second brush would look like this:
|
||||

|
||||

|
||||
|
||||
---
|
||||
### 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);
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user