函数:toStringType 将 table 格式的颜色值转换成 string

函数功能:将颜色值从 table 格式转换成 string 格式

TSLib 版本:仅 v1.2.8 及其以上版本支持

函数方法

str1,str2 = toStringType(tmp)

参数 类型 必填 说明
tmp table 颜色点阵
返回值 类型 说明
str1 string 基准点颜色值
str2 string 参考点颜色值

函数用例

require("TSLib")
local str1,str2 = toStringType( {
        {250,198,0x58d20e},
        {152,80,0x7c7e81},
        {224,83,0xffffff},
        {147,82,0x2b2f33},
        {137,13,0xffffff},
        {189,77,0xf8f8f9},
    })
dialog(string.format("颜色值为:0x%X",str1))
dialog(str2)

注意事项

  • 触动精灵已内置本函数库,无需下载

  • 雷电 9 系统模拟器分辨率为平板版时使用函数:getScreenSize 获取的屏幕宽高相反,获取到的宽度实际为屏幕高度,获取的高度实际为屏幕宽度,其他模拟器获取的屏幕宽高为实际屏幕宽高。

Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""