Changing an Excel cell's backcolor using hex results in Excel displaying completely different color in the spreadsheet

后端 未结 7 2010
灰色年华
灰色年华 2021-02-07 13:27

So I am setting an Excel cell\'s Interior Color to a certain value, like below:

worksheet.Cells[1, 1].Interior.Color = 0xF1DCDB;

However, when

7条回答
  •  天命终不由人
    2021-02-07 13:41

    Please note that this is not a bug!Red starts from the lower bit and Green is in the middle and Blue takes the highest bits

    B G R
    00000000 00000000 00000000

    The calculation is: (65536 * Blue) + (256 * Green) + (Red)

    Thank you.

提交回复
热议问题