Skip to content

Commit

Permalink
Reworked Color.NewAlpha functionality. Now calling of this method doe…
Browse files Browse the repository at this point in the history
…sn't affects instance.
  • Loading branch information
feafarot committed Aug 29, 2012
1 parent 998a652 commit 733e3ae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RazorTemplatesMvc.Sample/Content/test.cshtml
Expand Up @@ -6,6 +6,6 @@
}
*
{
color: @mainColor;
color: @mainColor;
}
</style>
1 change: 0 additions & 1 deletion RazorTemplatesMvc.sln
Expand Up @@ -7,7 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorTemplatesMvc", "RazorT
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "File Templates", "File Templates", "{D3F2E7B7-E2C6-470F-B18C-0B6B086FDE97}"
ProjectSection(SolutionItems) = preProject
LICENSE.txt = LICENSE.txt
File Templates\Razor Css Template (For .cshtml transform).zip = File Templates\Razor Css Template (For .cshtml transform).zip
File Templates\Razor Css Template (Razor CSCSS).zip = File Templates\Razor Css Template (Razor CSCSS).zip
File Templates\Razor Js Template (For .cshtml transform).zip = File Templates\Razor Js Template (For .cshtml transform).zip
Expand Down
2 changes: 1 addition & 1 deletion RazorTemplatesMvc/Handlers/TemplateRouteHttpHandler.cs
Expand Up @@ -7,7 +7,7 @@
using RazorEngine;

/// <summary>
/// Template MVC route and HTTP handler class definition.
/// Template MVC route and HTTP handler.
/// </summary>
public class TemplateRouteHttpHandler : IRouteHandler, IHttpHandler
{
Expand Down
17 changes: 15 additions & 2 deletions RazorTemplatesMvc/Helpers/Css/Color.cs
Expand Up @@ -15,6 +15,19 @@ public struct Color

private ColorDisplayBehavior colorDisplayBehavior;

/// <summary>
/// Initializes a new instance of the <see cref="Color"/> struct.
/// </summary>
/// <param name="color">All data will be copied from this color instance.</param>
public Color(Color color)
{
this.internalAlpha = color.Alpha;
this.red = color.Red;
this.green = color.Green;
this.blue = color.Blue;
this.colorDisplayBehavior = color.ColorDisplayBehavior;
}

/// <summary>
/// Initializes a new instance of the <see cref="Color"/> struct.
/// </summary>
Expand Down Expand Up @@ -125,8 +138,8 @@ public float Alpha
/// <returns>Updated color value.</returns>
public Color NewAlpha(float alpha)
{
Alpha = alpha;
return this;
var tempColor = new Color(this) { Alpha = alpha };
return tempColor;
}

/// <summary>
Expand Down

0 comments on commit 733e3ae

Please sign in to comment.