protected static void ExpectedValuesForKnownColor(IColorSpace knownColor, ILab expectedColor) { var target = knownColor.To<Lab>(); Assert.IsTrue(CloseEnough(expectedColor.L,target.L),"(L)" + expectedColor.L + " != " + target.L); Assert.IsTrue(CloseEnough(expectedColor.A,target.A),"(A)" + expectedColor.A + " != " + target.A); Assert.IsTrue(CloseEnough(expectedColor.B,target.B),"(B)" + expectedColor.B + " != " + target.B); }
protected static void ExpectedValuesForKnownColor(IColorSpace knownColor, ILab expectedColor) { var target = knownColor.To <Lab>(); Assert.AreEqual(expectedColor.L, target.L, 0.5, "(L)" + expectedColor.L + " != " + target.L); Assert.AreEqual(expectedColor.A, target.A, 0.64, "(A)" + expectedColor.A + " != " + target.A); Assert.AreEqual(expectedColor.B, target.B, 0.64, "(B)" + expectedColor.B + " != " + target.B); }
public LabController() { lab = new MLab(); proType = new MProjectType(); phaseType = new MPhaseType(); speedType = new MSpeedConnectionType(); labScop = new MLabScope(); }
protected static void ExpectedValuesForKnownColor(IColorSpace knownColor, ILab expectedColor) { var target = knownColor.To <Lab>(); Assert.IsTrue(CloseEnough(expectedColor.L, target.L), "(L)" + expectedColor.L + " != " + target.L); Assert.IsTrue(CloseEnough(expectedColor.A, target.A), "(A)" + expectedColor.A + " != " + target.A); Assert.IsTrue(CloseEnough(expectedColor.B, target.B), "(B)" + expectedColor.B + " != " + target.B); }
private void SetLabProperties(ILab x, DataRow dr) { SetBuildingProperties(x, dr); x.LabID = dr.Field <int>("LabID"); x.LabName = dr.Field <string>("LabName"); x.LabDisplayName = dr.Field <string>("LabDisplayName"); x.LabDescription = dr.Field <string>("LabDescription"); x.LabIsActive = dr.Field <bool>("LabIsActive"); }
public static LocationPathInfo Create(ILab lab) { LocationPathInfo result = new LocationPathInfo(); if (lab != null) { result.LabID = lab.LabID; } return(result); }
public HomeController() { dc = new MDataCenter(); off = new MOffice(); lab = new MLab(); fac = new MFactory(); other = new MOtherProject(); phaType = new MPhaseType(); proType = new MProjectType(); speed = new MSpeedConnectionType(); }
public static PathInfo Create(ILab lab) { PathInfo result = new PathInfo(); if (lab != null) { result.BuildingID = lab.BuildingID; result.LabID = lab.LabID; } return(result); }
internal static void ToColorSpace(IRgb color, ILab item) { var xyz = new Xyz(); xyz.Initialize(color); var x = PivotXyz(xyz.X/RefX); var y = PivotXyz(xyz.Y/RefY); var z = PivotXyz(xyz.Z/RefZ); item.L = Math.Max(0,116*y - 16); item.A = 500*(x - y); item.B = 200*(y - z); }
internal static void ToColorSpace(IRgb color, ILab item) { var xyz = new Xyz(); xyz.Initialize(color); var white = XyzConverter.WhiteReference; var x = PivotXyz(xyz.X / white.X); var y = PivotXyz(xyz.Y / white.Y); var z = PivotXyz(xyz.Z / white.Z); item.L = Math.Max(0, 116 * y - 16); item.A = 500 * (x - y); item.B = 200 * (y - z); }
internal static void ToColorSpace(IRgb color, ILab item) { var xyz = new Xyz(); xyz.Initialize(color); var x = PivotXyz(xyz.X / RefX); var y = PivotXyz(xyz.Y / RefY); var z = PivotXyz(xyz.Z / RefZ); item.L = Math.Max(0, 116 * y - 16); item.A = 500 * (x - y); item.B = 200 * (y - z); }
public ResourceTableItem(HttpContextBase context, IBuilding bld, ILab lab, IProcessTech pt, IResource res) { _context = context; BuildingID = bld.BuildingID; LabID = lab.LabID; ProcessTechID = pt.ProcessTechID; ResourceID = res.ResourceID; BuildingName = bld.BuildingName; LabName = lab.LabDisplayName; ProcessTechName = pt.ProcessTechName; ResourceName = res.ResourceName; LabUrl = VirtualPathUtility.ToAbsolute(string.Format("~/Lab.aspx?Path={0}&Date={1:yyyy-MM-dd}", PathInfo.Create(lab), _context.Request.SelectedDate())); ProcessTechUrl = VirtualPathUtility.ToAbsolute(string.Format("~/ProcessTech.aspx?Path={0}&Date={1:yyyy-MM-dd}", PathInfo.Create(pt), _context.Request.SelectedDate())); ResourceUrl = VirtualPathUtility.ToAbsolute(string.Format("~/ResourceDayWeek.aspx?Path={0}&Date={1:yyyy-MM-dd}", PathInfo.Create(res), _context.Request.SelectedDate())); }
internal static IRgb ToColor(ILab item) { var y = (item.L + 16.0) / 116.0; var x = item.A / 500.0 + y; var z = y - item.B / 200.0; var white = XyzConverter.WhiteReference; var xyz = new Xyz { X = white.X * (Math.Pow(x, 3) > XyzConverter.Epsilon ? Math.Pow(x, 3) : (x - 16.0 / 116.0) / 7.787), Y = white.Y * (item.L > (XyzConverter.Kappa * XyzConverter.Epsilon) ? Math.Pow(((item.L + 16.0) / 116.0), 3) : item.L / XyzConverter.Kappa), Z = white.Z * (Math.Pow(z, 3) > XyzConverter.Epsilon ? Math.Pow(z, 3) : (z - 16.0 / 116.0) / 7.787) }; return(xyz.ToRgb()); }
internal static IRgb ToColor(ILab item) { var y = (item.L + 16) / 116; var x = item.A / 500 + y; var z = y - item.B / 200; var white = ConvertXYZ.WhiteReference; var x3 = x * x * x; var z3 = z * z * z; var xyz = ColorXYZ.Empty; xyz.X = white.X * (x3 > 0.008856 ? x3 : (x - 0.137931034482759) / 7.787); xyz.Y = white.Y * (item.L > (7.9996248) ? System.Math.Pow(((item.L + 16) / 116), 3) : item.L / 903.3); xyz.Z = white.Z * (z3 > 0.008856 ? z3 : (z - 0.137931034482759) / 7.787); return(xyz.ToRgb()); }
public ILab ClientLab() { if (!Context.Items.Contains("ClientLab")) { var inlab = GetPhysicalAccessUtility().CurrentlyInLab; var badge = inlab.FirstOrDefault(x => x.ClientID == CurrentUser().ClientID); ILab lab = null; if (badge != null) { lab = CacheManager.Current.GetLab(badge.CurrentAreaName); } Context.Items["ClientLab"] = lab; } var result = (ILab)Context.Items["ClientLab"]; return(result); }
internal static IRgb ToColor(ILab item) { var y = (item.L + 16.0) / 116.0; var x = item.A / 500.0 + y; var z = y - item.B / 200.0; var white = XyzConverter.WhiteReference; var x3 = x * x * x; var z3 = z * z * z; var xyz = new Xyz { X = white.X * (x3 > XyzConverter.Epsilon ? x3 : (x - 16.0 / 116.0) / 7.787), Y = white.Y * (item.L > (XyzConverter.Kappa * XyzConverter.Epsilon) ? Math.Pow(((item.L + 16.0) / 116.0), 3) : item.L / XyzConverter.Kappa), Z = white.Z * (z3 > XyzConverter.Epsilon ? z3 : (z - 16.0 / 116.0) / 7.787) }; return xyz.ToRgb(); }
internal static IRgb ToColor(ILab item) { var y = (item.L + 16) / 116.0; var x = item.A / 500.0 + y; var z = y - item.B / 200.0; y = Math.Pow(y, 3) > 0.008856 ? Math.Pow(y, 3) : (y - 16/116)/7.787; x = Math.Pow(x, 3) > 0.008856 ? Math.Pow(x, 3) : (x - 16/116)/7.787; z = Math.Pow(z, 3) > 0.008856 ? Math.Pow(z, 3) : (z - 16/116)/7.787; var xyz = new Xyz { X = RefX*x, Y = RefY*y, Z = RefZ*z }; return xyz.ToRgb(); }
internal static IRgb ToColor(ILab item) { var y = (item.L + 16) / 116.0; var x = item.A / 500.0 + y; var z = y - item.B / 200.0; y = Math.Pow(y, 3) > 0.008856 ? Math.Pow(y, 3) : (y - 16 / 116) / 7.787; x = Math.Pow(x, 3) > 0.008856 ? Math.Pow(x, 3) : (x - 16 / 116) / 7.787; z = Math.Pow(z, 3) > 0.008856 ? Math.Pow(z, 3) : (z - 16 / 116) / 7.787; var xyz = new Xyz { X = RefX * x, Y = RefY * y, Z = RefZ * z }; return(xyz.ToRgb()); }
private static Color BlendLab(ILab color, ILab backColor, double log) { // var logInv = 1.0 - log; // var b = new Lab // { // A = color.A * log + backColor.A * logInv, // B = color.B * log + backColor.B * logInv, // L = color.L * log + backColor.L * logInv // }.ToRgb(); var b = new Lab { A = (color.A + backColor.A) * .5, B = (color.B + backColor.B) * .5, L = color.L * log }.ToRgb(); return(Color.FromRgb((byte)b.R, (byte)b.G, (byte)b.B)); }
internal static IRgb ToColor(ILab item) { double y = (item.L + 16.0) / 116.0; double x = item.A / 500.0 + y; double z = y - item.B / 200.0; IXyz white = XyzConverter.WhiteReference; double x3 = x * x * x; double z3 = z * z * z; var xyz = new Xyz { X = white.X * (x3 > XyzConverter.Epsilon ? x3 : (x - 16.0 / 116.0) / 7.787), Y = white.Y * (item.L > (XyzConverter.Kappa * XyzConverter.Epsilon) ? Math.Pow(((item.L + 16.0) / 116.0), 3) : item.L / XyzConverter.Kappa), Z = white.Z * (z3 > XyzConverter.Epsilon ? z3 : (z - 16.0 / 116.0) / 7.787) }; return(xyz.ToRgb()); }
public HunterLabColor(ILab lab) { Initialize(lab.ToRgb()); }
public LabColor(ILab lab) { Ordinals = lab.Ordinals; }
public CmyColor(ILab lab) { Initialize(lab.ToRgb()); }