rgb values to 0 to 1 scale

前端 未结 4 383
春和景丽
春和景丽 2021-02-02 06:53

I\'m trying to calculate some RGB colors (0 - 255) for a 0 to 1 scale. Does anyone knows a online converter or it exists a ma

4条回答
  •  逝去的感伤
    2021-02-02 07:37

    if you want to continue using 0-255 can create a function for this as the following example.

    function setFillColor2(...)
       local object,r,b,g=...
       object:setFillColor( r/255, b/255,g/255)
    end
    
    circle1 = display.newCircle(150,250, 50 ) 
    setFillColor2(circle1,23,255,12)
    

提交回复
热议问题