<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                [TOC] > Sat May 08 2021 19:49:27 GMT+0800 (GMT+08:00) 我對顏色表示這一塊也沒怎么深入學習過,大概講一點吧,在計算機的顏色通常說的是 RGB 顏色碼,它們長這個樣子:`rgb(0,222,45)`,不同編程語言的表示可能不一樣,但規則是相同的。最小值是0,最大值是255,共 256個等級。 我們不妨直接跑跑宏,看看效果。 ## 使用 Color 屬性 ```js function _m_color(){ let rng = Range("A1:M20") for(let i = 1;i<256;i++){ let item_cell = rng.Item(i) item_cell.Value2 = i-1; item_cell.Interior.Color = i-1 } } ``` > 嗯,效果嘛,看起來只有 RGB 的 Red 部分,沒有 Green 和 Black 的部分,下面我們來修正它。 ### 使用 RGB > `256 x 256 x 256` 量太大,我們簡單點弄吧。(0-255 共 256) ```js function _m_colorRGB(){ let rng = Range("A1:M20") for(let i = 1;i<256;i++){ let item_cell = rng.Item(i) item_cell.Value2 = i-1; let r = WorksheetFunction.RandBetween(0,255) let g = WorksheetFunction.RandBetween(0,255) let b = WorksheetFunction.RandBetween(0,255) item_cell.Interior.Color =r*g*b } } ``` ## 使用 ColorIndex 屬性 經測試只有 56 種顏色。 ```js function _m_colorIndex(){ let rng = Range("A1:M20") for(let i = 1;i<57;i++){ let item_cell = rng.Item(i) item_cell.Value2 = i-1; item_cell.Interior.ColorIndex = i-1 } } ``` ## 延伸 RGB 顏色碼轉換; * RGB 二進制表示,例如:`00000000 00000000 00000000` * RGB 十進制表示(前面我們用的都是十進制),例如:3 * RGB 十六進制表示,例如:#FFB400 ### RGB Alpha 在 RGB 的基礎上再加一個 Alpha 通道。通常用來控制透明度。它看起來像 `rgba(100, 34, 90, 0.6)`,在 WPS 中,一般只有圖片、圖形、藝術字等這類對象才會用到 RGBA 顏色。 ## 顏色枚舉 為方便使用,人們會把 RGB 顏色具名化,其實就是類似 Red、Green、white……等這樣的英文名稱描述,只是在 API 中加上了 `"rgb"` 前綴 >當你不知道具體顏色的顏色值或 RGB 組合,可以使用API中斷的顏色枚舉值(其實就是顏色值,只是用名稱來代替)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看