MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / ToCode

Method ToCode

Examples/StereoKitTest/Tools/ThemeEditor.cs:36–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 }
35
36 public string ToCode()
37 {
38 Color primary = UI.GetThemeColor(UIColor.Primary);
39 Color background = UI.GetThemeColor(UIColor.Background);
40 Color common = UI.GetThemeColor(UIColor.Common);
41 Color complement = UI.GetThemeColor(UIColor.Complement);
42 Color text = UI.GetThemeColor(UIColor.Text);
43 return @$"// Theme code generated by theme editor!
44UI.Settings = new UISettings
45{{
46 margin = {settings.margin:0.000}f,
47 padding = {settings.padding:0.000}f,
48 gutter = {settings.gutter:0.000}f,
49 depth = {settings.depth:0.000}f,
50 rounding = {settings.rounding:0.000}f
51}};
52UI.SetThemeColor(UIColor.Primary, new Color({primary.r :0.000}f,{primary.g :0.000}f,{primary.b :0.000}f));
53UI.SetThemeColor(UIColor.Background, new Color({background.r:0.000}f,{background.g:0.000}f,{background.b:0.000}f));
54UI.SetThemeColor(UIColor.Common, new Color({common.r :0.000}f,{common.g :0.000}f,{common.b :0.000}f));
55UI.SetThemeColor(UIColor.Complement, new Color({complement.r:0.000}f,{complement.g:0.000}f,{complement.b:0.000}f));
56UI.SetThemeColor(UIColor.Text, new Color({text.r :0.000}f,{text.g :0.000}f,{text.b :0.000}f));
57";
58 }
59
60 public static Theme FromCurrent()
61 {

Callers 1

StepMethod · 0.80

Calls 1

GetThemeColorMethod · 0.80

Tested by

no test coverage detected