github.com/secoba/wails/v2@v2.6.4/internal/frontend/desktop/windows/winc/color.go (about)

     1  //go:build windows
     2  
     3  /*
     4   * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
     5   * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
     6   */
     7  
     8  package winc
     9  
    10  type Color uint32
    11  
    12  func RGB(r, g, b byte) Color {
    13  	return Color(uint32(r) | uint32(g)<<8 | uint32(b)<<16)
    14  }
    15  
    16  func (c Color) R() byte {
    17  	return byte(c & 0xff)
    18  }
    19  
    20  func (c Color) G() byte {
    21  	return byte((c >> 8) & 0xff)
    22  }
    23  
    24  func (c Color) B() byte {
    25  	return byte((c >> 16) & 0xff)
    26  }