S4MuEL Posted May 6, 2013 Share Posted May 6, 2013 السلآمم عليكمم ممكن ششرح لـ rGBToHex ؟ Link to comment
кιηg-αвα∂у Posted May 6, 2013 Share Posted May 6, 2013 يحول الألوان الي تكون كذا r, g, b للهيكس يعني مثلآ لون احمر 255, 0, 0 يحولها كذا #ff0000 طريقة التحويل color = RGBToHex(255,0,0) لآزم تضيف كود الفنكشن function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now