public RTEColors() { Primary = DefaultPrimary; Secondary = DefaultSecondary; Border = DefaultBorder; Border2 = DefaultBorder2; Border3 = DefaultBorder3; Border4 = DefaultBorder4; Accent = DefaultAccent; Text = DefaultText; Text2 = DefaultText2; ModalOverlay = DefaultModalOverlay; MainMenuBar = DefaultMainMenuBar; ToolsToggle = DefaultToolsToggle; Footer = DefaultFooter; MainMenuButton = DefaultMainMenuButton; MenuItem = DefaultMenuItem; Hierarchy = DefaultHierarchy; ProjectFolder = DefaultProjectFolder; ConsoleButton = DefaultConsoleButton; ScrollBar = DefaultScrollBar; ScrollBarBackground = DefaultScrollBarBackground; Toggle = DefaultToggle; Toggle2 = DefaultToggle2; ToggleButton = DefaultToggleButton; InputField = DefaultInputField; InputField2 = DefaultInputField2; Button = DefaultButton; Button2 = DefaultButton2; Slider = DefaultSlider; Dropdown = DefaultDropdown; ToolCmdItem = DefaultToolCmdItem; }
private void InvertColors() { foreach (FieldInfo field in Colors.GetType().GetFields()) { object val = field.GetValue(Colors); if (val is Color) { Color color = (Color)val; field.SetValue(Colors, Invert(color)); } else if (val is RTESelectableColors) { RTESelectableColors colors = (RTESelectableColors)val; colors.Disabled = Invert(colors.Disabled); colors.Highlight = Invert(colors.Highlight); colors.Normal = Invert(colors.Normal); colors.Pressed = Invert(colors.Pressed); colors.Selected = Invert(colors.Selected); field.SetValue(Colors, colors); } else if (val is RTEHierarchyColors) { RTEHierarchyColors colors = (RTEHierarchyColors)val; colors.DisabledItem = Invert(colors.DisabledItem); colors.NormalItem = Invert(colors.NormalItem); field.SetValue(Colors, colors); } else if (val is RTEMenuItemColors) { RTEMenuItemColors colors = (RTEMenuItemColors)val; colors.DisabledSelectionColor = Invert(colors.DisabledSelectionColor); colors.DisabledTextColor = Invert(colors.DisabledTextColor); colors.SelectionColor = Invert(colors.SelectionColor); colors.TextColor = Invert(colors.TextColor); field.SetValue(Colors, colors); } else { Debug.LogWarning("Unknown type " + val.GetType()); } } }
public bool EqualTo(RTEHierarchyColors c) { return (c.NormalItem == NormalItem && c.DisabledItem == DisabledItem); }