First Machine Age's Mods (Combined repo.)
Révision | 63869fc81778186eb5e9987cce05a0d579e41b3d (tree) |
---|---|
l'heure | 2020-08-10 08:49:27 |
Auteur | melchior <melchior@user...> |
Commiter | melchior |
Added implicit color conversion routines, for ease of use.
@@ -46,7 +46,10 @@ namespace ElementalTools | ||
46 | 46 | Alpha = a; |
47 | 47 | } |
48 | 48 | |
49 | - | |
49 | + public static implicit operator int(RGBAColor_Int32 input) | |
50 | + { | |
51 | + return input.IntegerValue; | |
52 | + } | |
50 | 53 | } |
51 | 54 | |
52 | 55 | [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 1)] |
@@ -85,7 +88,10 @@ namespace ElementalTools | ||
85 | 88 | Alpha = a; |
86 | 89 | } |
87 | 90 | |
88 | - | |
91 | + public static implicit operator int(BGRAColor_Int32 input) | |
92 | + { | |
93 | + return input.IntegerValue; | |
94 | + } | |
89 | 95 | } |
90 | 96 | |
91 | 97 |
@@ -554,25 +554,25 @@ namespace ElementalTools | ||
554 | 554 | |
555 | 555 | switch (edge) { |
556 | 556 | case SharpnessState.Rough: |
557 | - return this.color_Rough.IntegerValue; | |
557 | + return this.color_Rough; | |
558 | 558 | |
559 | 559 | case SharpnessState.Dull: |
560 | - return this.color_Dull.IntegerValue; | |
560 | + return this.color_Dull; | |
561 | 561 | |
562 | 562 | case SharpnessState.Honed: |
563 | - return this.color_Honed.IntegerValue; | |
563 | + return this.color_Honed; | |
564 | 564 | |
565 | 565 | case SharpnessState.Keen: |
566 | - return this.color_Keen.IntegerValue; | |
566 | + return this.color_Keen; | |
567 | 567 | |
568 | 568 | case SharpnessState.Sharp: |
569 | - return this.color_Sharp.IntegerValue; | |
569 | + return this.color_Sharp; | |
570 | 570 | |
571 | 571 | case SharpnessState.Razor: |
572 | - return this.color_Razor.IntegerValue; | |
572 | + return this.color_Razor; | |
573 | 573 | } |
574 | 574 | |
575 | - return this.color_Default.IntegerValue; | |
575 | + return this.color_Default; | |
576 | 576 | } |
577 | 577 | |
578 | 578 | #endregion |