Module: RatatuiRuby::Symbols::Shade
- Defined in:
- lib/ratatui_ruby/symbols.rb
Overview
Shade characters for creating gradient or density effects.
Terminal UIs often need to show density levels or create visual gradients. Memorizing Unicode block characters is tedious and error-prone.
These constants provide named access to the standard shade characters. Use them to fill areas with varying visual densities.
Examples
– SPDX-SnippetBegin SPDX-FileCopyrightText: 2026 Kerrick Long SPDX-License-Identifier: MIT-0 ++
# Create a density gradient
gradient = [Shade::EMPTY, Shade::LIGHT, Shade::MEDIUM, Shade::DARK, Shade::FULL]
# Use in a progress indicator
filled = Shade::FULL * progress
empty = Shade::LIGHT * (total - progress)
– SPDX-SnippetEnd ++
Constant Summary collapse
- EMPTY =
Empty space - 0% density.
" "- LIGHT =
Light shading - approximately 25% density.
"░"- MEDIUM =
Medium shading - approximately 50% density.
"▒"- DARK =
Dark shading - approximately 75% density.
"▓"- FULL =
Full block - 100% density.
"█"