SetColor
BlitzMax Forums/BlitzMax Programming/SetColor
| ||
How can I pass the following color as a parameter: SetColor(23,197,224) I was kind of hoping there was a way to pass the color without creating a custom type? Also, I will want to use it in set color later. Thanks |
| ||
28*65536+197*256+224 OR you can have this Type TRgb 'A Colour Tri Field FRed:Int Field FGreen:Int Field FBlue:Int ' ------------------------------- Method Set:TRgb(ARed:Int,AGreen:Int,ABlue:Int) Self.FRed = ARed Self.FGreen = AGreen Self.FBlue = ABlue Return Self End Method ' ------------------------------- Function Create:TRgb(ARed:Int=0,AGreen:Int=0,ABlue:Int=0) Return New TRgb.Set(ARed,AGreen,ABlue) End Function ' -------------------------------- Method CreateCopy:TRgb() Return TRgb.Create (Self.FRed,Self.FGreen,Self.FBlue) End Method ' -------------------------------- Method SetDim (APercent:Int) Self.FBlue:* (APercent/100.0) Self.FGreen:* (APercent/100.0) Self.FBlue:* (APercent/100.0) End Method End Type |