업데이트됨

AmendLogic CSS - Brand and Semantic Color Library

427
Overview
AmendLogic_CSS is a centralized style and theme utility library for Pine Script v6. It provides a standardized color palette designed to maintain visual consistency across indicators, strategies, and UI components. By shifting color management to a library, scripts stay clean, modular, and easy to maintain.

Key Features
  • Unified Brand Identity: Access core AmendLogic brand colors ("blue", "cyan", "purple", etc.) instantly via a single wrapper function.
  • Semantic Trade Layering: Includes a pre-graded 5-tier Take-Profit color matrix ("tp1" to "tp5") to design clean, incremental scaling visuals on your charts.
  • Adaptive Theme Detection ("colorVar"): Features a built-in environment check. It analyzes the user's current chart background on the fly, dynamically switching text/line elements between light and dark modes to guarantee perfect contrast and readability.
  • Inline Alpha Control: The getColor() function supports a native transparency parameter ($0$ to $100$), removing the need to wrap color outputs in separate color.new() calls manually.


How to Use (Quick Start)
To implement this design framework into your own indicators or strategies, simply import the library at the top of your script and query your desired color string:

Pine Script®


Available Color IDs:
  • Brand: "blue", "cyan", "purple", "gray", "black"
  • UI Semantics: "green", "red", "yellow"
  • Targets: "tp1", "tp2", "tp3", "tp4", "tp5"
  • Adaptive: "colorVar" (Dynamic contrast toggle)
릴리즈 노트
v2

Added:
method alpha(c, transp)
  Namespace types: series color, simple color, input color, const color
  Parameters:
    c (color): The base color.
/ param transp The transparency level (0 is fully opaque, 100 is fully transparent).
/ Returns A new color instance with the applied transparency.
    transp (int)

get_colors()
  Generates the AmendLogic theme based on the current chart's background luminance (Light/Dark mode auto-detection).
/ Returns A populated `Theme` object containing context-aware colors.

Theme
  Container for all AmendLogic standard theme colors.
  Fields:
    C_BRAND (series color): Primary brand color.
    C_SL (series color): Stop Loss text or foreground color.
    C_TP (series color): Take Profit text or foreground color.
    C_SL_BG (series color): Stop Loss background color.
    C_TP_BG (series color): Take Profit background color.
    C_BG (series color): Main background color.
    C_BORDER (series color): Standard border or frame color.
    C_HEAD_BG (series color): Table or header background color.
    C_TEXT_MAIN (series color): Primary text color.
    C_TEXT_MUTED (series color): Secondary or muted text color.

Removed:
getColor(color_id, t)
  Returns a color from the AmendLogic palette.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.