Skip to main content
Color options control the visual appearance of vectors through static colors, angle-based rainbow coloring, and magnitude-based dimming effects.

Static Colors

main_color
Color
default:"Color.YELLOW"
Color for the main vector arrow.
  • Type: Godot Color object
  • Default: Yellow Color(1, 1, 0, 1)
  • Applies to: The primary vector visualization
  • Overridden by: rainbow mode (when enabled)
Usage:
# Set using predefined colors
settings.main_color = Color.CYAN

# Set using RGB values
settings.main_color = Color(0.5, 0.8, 1.0)

# Set with alpha transparency
settings.main_color = Color(1, 0, 0, 0.7)  # Semi-transparent red
x_axis_color
Color
default:"Color.RED"
Color for the X component of the vector.
  • Type: Godot Color object
  • Default: Red Color(1, 0, 0, 1)
  • Applies to: Horizontal (X) component when show_axes is enabled
  • Not affected by: rainbow mode (axes always use static colors)
Convention: Red for X-axis follows standard mathematical visualization
y_axis_color
Color
default:"Color.GREEN"
Color for the Y component of the vector.
  • Type: Godot Color object
  • Default: Green Color(0, 1, 0, 1)
  • Applies to: Vertical (Y) component when show_axes is enabled
  • Not affected by: rainbow mode (axes always use static colors)
Convention: Green for Y-axis follows standard mathematical visualization

Rainbow Mode

rainbow
bool
default:"false"
Enable angle-based color cycling for the main vector.When enabled:
  • Main vector color is determined by its angle
  • Creates a full spectrum as vectors rotate 360 degrees
  • Overrides main_color setting
  • Axis components still use their static colors
Color Mapping:
  • 0° (right): Red
  • 60°: Yellow
  • 120° (up-left): Green
  • 180° (left): Cyan
  • 240°: Blue
  • 300° (down-right): Magenta
  • 360°: Red (full cycle)
Implementation:
var angle: float = vector.angle()  # Get angle in radians
if angle < 0: angle += TAU         # Normalize to [0, TAU]
colors.main = Color.from_hsv(angle / TAU, 1.0, 1.0)
Use Cases:
  • Visualize rotation or angular velocity
  • Make direction immediately apparent through color
  • Create engaging educational visualizations
  • Debug rotational behavior
Rainbow mode uses full saturation (1.0) and full value (1.0) for vivid colors. Dimming can still be applied on top of rainbow colors.

Color Dimming

Dimming gradually transitions vector colors toward a fallback color as vectors become shorter, providing visual feedback about magnitude.
dimming
bool
default:"false"
Enable magnitude-based color dimming.When enabled:
  • Short vectors blend toward fallback_color
  • Long vectors maintain their full color
  • Applies to both main vector and axes
  • Works with both static colors and rainbow mode
When disabled:
  • Vectors always display at full color intensity
  • No magnitude indication through color
Visual Effect:
  • Provides immediate visual feedback of vector strength
  • Helps distinguish between active and near-zero vectors
  • Creates smooth color transitions as magnitude changes
dimming_speed
float
default:"1.0"
Controls how quickly colors dim as vectors get shorter.
  • Range: 0.01 to 10+
  • Increment: 0.01
  • Default: 1.0 (standard dimming rate)
Behavior:
  • Higher values (2.0+): Faster dimming, colors fade at longer lengths
  • Lower values (0.1-0.5): Slower dimming, colors stay vibrant until very short
  • Value of 1.0: Balanced dimming for typical use cases
Formula:
dimming_value = clamp(dimming_speed * 10 / vector.length(), 0.0, 1.0)
final_color = base_color.lerp(fallback_color, dimming_value)
Note: Internal correction factor of 10 is applied for better control rangeExamples:
  • 0.5: Very gradual dimming, maintains color until almost zero
  • 1.0: Default, balanced dimming
  • 3.0: Aggressive dimming, transitions to fallback quickly
fallback_color
Color
default:"Color.BLACK"
Target color for dimmed vectors.
  • Type: Godot Color object
  • Default: Black Color(0, 0, 0, 1)
  • Effect: Vectors smoothly blend to this color as they approach zero length
Common Choices:
  • Black (default): Vectors fade out, good for dark backgrounds
  • White: Fade to white, good for light backgrounds
  • Gray: Maintain some visibility at zero length
  • Matching background: Complete visual fade-out
Usage:
# Fade to gray instead of black
settings.fallback_color = Color(0.3, 0.3, 0.3)

# Fade to white for light themes
settings.fallback_color = Color.WHITE

# Fade to transparent (requires alpha blending)
settings.fallback_color = Color(0, 0, 0, 0)
normalized_dimming_type
enum
default:"None"
Controls dimming behavior when using Normalize length mode.
No dimming when length mode is “Normalize”.Behavior:
  • All normalized vectors display at full color
  • Dimming is completely disabled
  • Simplest option for direction-only visualization
When to use: You only want to show direction and dimming would be misleading
This setting only affects dimming behavior when length_mode is “Normalize”. With “Normal” or “Clamp” modes, dimming always uses the visual length.

Color Interaction

Understanding how rainbow mode and dimming work together:
Result: Static colors at full intensity
  • Main vector: main_color
  • X-axis: x_axis_color
  • Y-axis: y_axis_color
  • No variation based on angle or magnitude
Result: Angle-based colors at full intensity
  • Main vector: Color changes with angle (full spectrum)
  • X-axis: Still uses x_axis_color (static)
  • Y-axis: Still uses y_axis_color (static)
  • Direction is immediately visible, no magnitude indication
Result: Static colors that fade with magnitude
  • Main vector: main_colorfallback_color blend
  • X-axis: x_axis_colorfallback_color blend
  • Y-axis: y_axis_colorfallback_color blend
  • Magnitude is indicated through color intensity
Result: Angle-based colors that fade with magnitude
  • Main vector: Rainbow color → fallback_color blend
  • X-axis: x_axis_colorfallback_color blend
  • Y-axis: y_axis_colorfallback_color blend
  • Both direction (hue) and magnitude (brightness) are visible
  • Most visually rich option

Common Configurations

settings.main_color = Color.YELLOW
settings.x_axis_color = Color.RED
settings.y_axis_color = Color.GREEN
settings.rainbow = false
settings.dimming = false
Clear, professional visualization with standard colors.
settings.rainbow = true           # Color shows direction
settings.dimming = true           # Brightness shows magnitude
settings.dimming_speed = 1.5
settings.fallback_color = Color.BLACK
Perfect for rotating objects or directional forces.
settings.main_color = Color.CYAN
settings.x_axis_color = Color(1, 0, 0)     # Bright red
settings.y_axis_color = Color(0, 1, 0)     # Bright green
settings.rainbow = false
settings.dimming = true
settings.dimming_speed = 2.0
settings.fallback_color = Color(0.2, 0.2, 0.2)  # Dark gray
High contrast for presentations and learning materials.
# In rendering options:
settings.length_mode = "Normalize"
settings.max_length = 100.0

# Color options:
settings.rainbow = true                      # Direction via color
settings.dimming = true                      # Magnitude via intensity
settings.normalized_dimming_type = "Absolute"  # Use original magnitude
settings.dimming_speed = 1.0
settings.fallback_color = Color.BLACK
All vectors same length, but color shows direction and brightness shows original magnitude.

Color Calculation Order

Colors are processed in this sequence:
  1. Start with base colors (main_color, x_axis_color, y_axis_color)
  2. Apply rainbow (if enabled): Replace main_color with angle-based hue
  3. Apply dimming (if enabled):
    • Calculate dimming value based on vector length and dimming_speed
    • Lerp from current color to fallback_color
  4. Render with final calculated colors

Source Reference

  • Color settings definition: vector_display_settings.gd:44-74
  • Color calculation logic: vector_display_functions.gd:34-69
  • Rainbow angle calculation: vector_display_functions.gd:47-51
  • Dimming blend calculation: vector_display_functions.gd:54-67

Build docs developers (and LLMs) love