From 2d9808b2dc3c06f00b8e77e7af4b2212f9e4d185 Mon Sep 17 00:00:00 2001 From: RGBCube <78925721+RGBCube@users.noreply.github.com> Date: Fri, 18 Nov 2022 20:03:14 +0300 Subject: [PATCH] term: add term.slow_blink/1 and term.rapid_blink/1 (#16470) --- vlib/term/colors.v | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vlib/term/colors.v b/vlib/term/colors.v index 33110bfda4..eb34d3d00b 100644 --- a/vlib/term/colors.v +++ b/vlib/term/colors.v @@ -47,6 +47,17 @@ pub fn underline(msg string) string { return format(msg, '4', '24') } +// slow_blink will surround the `msg` with ANSI escape codes for blinking (less than 150 times per minute). +pub fn slow_blink(msg string) string { + return format(msg, '5', '25') +} + +// rapid_blink will surround the `msg` with ANSI escape codes for blinking (over 150 times per minute). +// Note that unlike slow_blink, this is not very widely supported. +pub fn rapid_blink(msg string) string { + return format(msg, '6', '26') +} + pub fn inverse(msg string) string { return format(msg, '7', '27') }