Skip to content

Instantly share code, notes, and snippets.

@cameronmcefee
Created January 2, 2013 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronmcefee/4439382 to your computer and use it in GitHub Desktop.
Save cameronmcefee/4439382 to your computer and use it in GitHub Desktop.
Here's a snipped from my ui color switcher. Right now it's dependent on the CSXSInterface to get the info. I need to figure out if there's a way to get the info without it.
// Get the color from the app
var i:Number = 0;
var uiObjects:Array = new Array();
var uiResult:SyncRequestResult = CSXSInterface.instance.getHostEnvironment();
var hostData:HostEnvironment = uiResult.data;
var skinInfo:AppSkinInfo = hostData.appSkinInfo;
var appUILightness:Number;
// Color value from the ui
defaultColor = skinInfo.panelBackgroundColor.color.rgb;
// Color value from the ui on a scale of 0 (black) to 1(white)
// Elsewhere in my code I test against it
//
// uiColor = (appUILightness>.5) ? 0xffffff : 0x000000
appUILightness = defaultColor/16777215
this.setStyle("backgroundGradientColors", [defaultColor, defaultColor]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment