PINE LIBRARY
AmendLogic CSS - Brand and Semantic Color Library

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
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:
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:
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)
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.