From 2f5421a5c9b060bfc58d121b003443a72f9dc6e7 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 8 Aug 2023 03:00:41 -0400 Subject: [PATCH] Add Role constructor --- theme/theme.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/theme/theme.go b/theme/theme.go index b362c8d..70aecbd 100644 --- a/theme/theme.go +++ b/theme/theme.go @@ -18,6 +18,11 @@ type Role struct { Object string } +// R is shorthand for creating a Role structure. +func R (pack, object string) Role { + return Role { Package: pack, Object: object } +} + // Theme is an object that can apply a visual style to different objects. type Theme interface { // Apply applies the theme to the given object, according to the given