func SysColor(color string) term.Attribute {
	thememtx.RLock()
	sch, ok := themeManager.themes[themeManager.current]
	if !ok {
		sch = themeManager.themes[defaultTheme]
	}
	thememtx.RUnlock()

	clr, okclr := sch.colors[color]
	if !okclr {
		visited := make(map[string]int, 0)
		visited[themeManager.current] = 1
		if !ok {
			visited[defaultTheme] = 1
		}

		for {
			if sch.parent == "" {
				break
			}
			themeManager.loadTheme(sch.parent)
			thememtx.RLock()
			sch = themeManager.themes[sch.parent]
			clr, okclr = sch.colors[color]
			thememtx.RUnlock()

			if ok {
				break
			} else {
				if _, okSch := visited[sch.parent]; okSch {
					panic("Color + " + color + ". Theme loop detected: " + sch.title + " --> " + sch.parent)
				} else {
					visited[sch.parent] = 1
				}
			}
		}
	}

	return clr
}
func SysColor(color string) term.Attribute {
	thememtx.RLock()
	sch, ok := themeManager.themes[themeManager.current]
	if !ok {
		sch = themeManager.themes[defaultTheme]
	}
	thememtx.RUnlock()

	clr, okclr := sch.colors[color]
	if !okclr {
		visited := make(map[string]int, 0)
		visited[themeManager.current] = 1
		if !ok {
			visited[defaultTheme] = 1
		}

		for {
			if sch.parent == "" {
				break
			}
			themeManager.loadTheme(sch.parent)
			thememtx.RLock()
			sch = themeManager.themes[sch.parent]
			clr, okclr = sch.colors[color]
			thememtx.RUnlock()

			if ok {
				break
			} else {
				if _, okSch := visited[sch.parent]; okSch {
					panic("Color + " + color + ". Theme loop detected: " + sch.title + " --> " + sch.parent)
				} else {
					visited[sch.parent] = 1
				}
			}
		}
	}

	return clr
}
func SysColor ( color string ) term . Attribute { thememtx . RLock ( ) sch , ok := themeManager . themes [ themeManager . current ] if ! ok { sch = themeManager . themes [ defaultTheme ] } thememtx . RUnlock ( ) clr , okclr := sch . colors [ color ] if ! okclr { visited := make ( map [ string ] int , 0 ) visited [ themeManager . current ] = 1 if ! ok { visited [ defaultTheme ] = 1 } for { if sch . parent == " " { break } themeManager . loadTheme ( sch . parent ) thememtx . RLock ( ) sch = themeManager . themes [ sch . parent ] clr , okclr = sch . colors [ color ] thememtx . RUnlock ( ) if ok { break } else { if _ , okSch := visited [ sch . parent ] ; okSch { panic ( " " + color + " " + sch . title + " " + sch . parent ) } else { visited [ sch . parent ] = 1 } } } } return clr }
// SysColor returns attribute by its id for the current theme.
// The method panics if theme loop is detected - check if
// parent attribute is correct
SysColor returns attribute by its id for the current theme . The method panics if theme loop is detected - check if parent attribute is correct