Skip to content

Instantly share code, notes, and snippets.

@samilamti
Created March 30, 2013 09:12
Show Gist options
  • Save samilamti/5276037 to your computer and use it in GitHub Desktop.
Save samilamti/5276037 to your computer and use it in GitHub Desktop.
Shared UIDefinitions class that needs to be implemented per platform to create the platform's native color object given RGB-values.
namespace NinjaLocator.Core
{
public abstract class UIDefinitions<TNativeColor>
{
protected abstract TNativeColor TranslateColor(byte red, byte green, byte blue);
private static UIDefinitions<TNativeColor> _instance;
public static TNativeColor BackgroundColor { get { return _instance.TranslateColor(Configuration.BG_RED, Configuration.BG_GREEN, Configuration.BG_BLUE); } }
public static TNativeColor ForegroundColor { get { return _instance.TranslateColor(Configuration.FG_RED, Configuration.FG_GREEN, Configuration.FG_BLUE); } }
protected UIDefinitions()
{
_instance = this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment