mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Add Color.lightened and Color.darkened (like LESS.css or SASS)
This commit is contained in:
committed by
Kyle Van Berendonck
parent
c846e49a7d
commit
8e4336a729
@@ -126,6 +126,32 @@
|
||||
[/codeblock]
|
||||
</description>
|
||||
</method>
|
||||
<method name="lightened">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="amount" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a new color resulting from making this color lighter by the specified percentage (0-1).
|
||||
[codeblock]
|
||||
var green = Color(0.0, 1.0, 0.0)
|
||||
var lightgreen = green.lightened(0.2) # 20% lighter than regular green
|
||||
[/codeblock]
|
||||
</description>
|
||||
</method>
|
||||
<method name="darkened">
|
||||
<return type="Color">
|
||||
</return>
|
||||
<argument index="0" name="amount" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a new color resulting from making this color darker by the specified percentage (0-1).
|
||||
[codeblock]
|
||||
var green = Color(0.0, 1.0, 0.0)
|
||||
var darkgreen = green.darkened(0.2) # 20% darker than regular green
|
||||
[/codeblock]
|
||||
</description>
|
||||
</method>
|
||||
<method name="linear_interpolate">
|
||||
<return type="Color">
|
||||
</return>
|
||||
|
||||
Reference in New Issue
Block a user