• Prodotti
  • Comunità
  • Mercati
  • Broker
  • Altro
Inizia
  • Indicatori e strategie
  • /NTSC

NTSC

Better Contrast (NTSC Optimized)Library Better Contrast (NTSC Optimized) This lightweight utility library automatically selects the optimal text color (black or white) for any given background color, ensuring maximum readability for labels, tables, and UI elements. Unlike standard libraries that use the HSP model or simple averaging, this library utilizes the NTSC Perceived Brightness formula. 🟢 Why NTSC? The human eye is significantly more sensitive to green light than red or blue. Standard formulas often miscalculate brightness for high‑energy colors like yellow (red + green) or cyan, resulting in white text on bright yellow backgrounds — which is hard to read. The NTSC formula weights colors based on human perception: Brightness = (Red * 0.299) + (Green * 0.587) + (Blue * 0.114) By heavily weighting the green channel (58.7%), this method correctly identifies yellow and cyan as “bright” backgrounds, forcing the text to black for superior contrast. 🛠 Usage Import the library: import Robertsanktov/Better_Contrast/1 as contrast Use the method directly on any color variable: textColor = myBackgroundColor.contrast() Parameters - threshold : (optional) brightness cutoff (0.0–1.0 or 0–255). Default is 0.55 . Higher values force more white text; lower values force more black text.
Libreria Pine Script®
di Robertsanktov

Dati di mercato selezionati forniti da ICE Data Services. Dati di riferimento selezionati forniti da FactSet. Copyright © 2026 FactSet Research Systems Inc.Copyright © 2026, American Bankers Association. Database CUSIP fornito da FactSet Research Systems Inc. Tutti i diritti riservati. Documenti depositati presso la SEC e altri documenti forniti da Quartr.© 2026 TradingView, Inc.

Più che un semplice prodotto
  • Grafici
Screener
  • Azioni
  • ETF
  • Obbligazioni
  • Singole cripto
  • Coppie CEX
  • Coppie DEX
  • Pine
Heatmap
  • Azioni
  • ETF
  • Singole cripto
Calendari
  • Economico
  • Utili
  • Dividendi
Altri prodotti
  • Curve di rendimento
  • Opzioni
  • Notiziario
  • Pine Script®
Applicazioni
  • Smartphone
  • Desktop
Comunità
  • Social network
  • Muro social
  • Invita un amico
  • Regolamento
  • Moderatori
Idee
  • Trading
  • Formazione
  • Selezione editoriale
Pine Script
  • Indicatori e strategie
  • Maestri
  • Freelancer
Strumenti e abbonamenti
  • Caratteristiche
  • Costi
  • Dati di mercato
  • Regala abbonamenti
Trading
  • Panoramica
  • Broker
Offerte speciali
  • Futures CME Group
  • Futures Eurex
  • Bundle azioni USA
Informazioni sulla società
  • Chi siamo
  • Missione spaziale
  • Blog
  • Carriere
  • Kit multimediale
Merchandising
  • TradingView Shop
  • I tarocchi per i trader
  • C63 TradeTime
Politiche e sicurezza
  • Condizioni d'uso
  • Declinazione di responsabilità
  • Normativa sulla privacy
  • Politica sui cookies
  • Dichiarazione di accessibilità
  • Consigli per la sicurezza
  • Programma bug bounty
  • Pagina di stato
Soluzioni per le aziende
  • Widget
  • Librerie grafiche
  • Lightweight Charts™
  • Grafici avanzati
  • Piattaforma di trading
Opportunità di crescita
  • Pubblicità
  • Integrazione broker
  • Programma affiliazione
  • Programma di formazione
Comunità
  • Social network
  • Muro social
  • Invita un amico
  • Regolamento
  • Moderatori
Idee
  • Trading
  • Formazione
  • Selezione editoriale
Pine Script
  • Indicatori e strategie
  • Maestri
  • Freelancer
Soluzioni per le aziende
  • Widget
  • Librerie grafiche
  • Lightweight Charts™
  • Grafici avanzati
  • Piattaforma di trading
Opportunità di crescita
  • Pubblicità
  • Integrazione broker
  • Programma affiliazione
  • Programma di formazione
Look FirstLook First