public void ColorToBgra32_Color_IntColor() { //arrange int expected; unchecked { expected = (int)0xFF98FB98; } //action int actual = ColorUtilities.ColorToBgra32(Colors.PaleGreen); //assert Assert.AreEqual(expected, actual); }
public void ColorToBgra32Test_ColorChannelValues_BgraIntColor() { //arrange int expected; unchecked { expected = (int)0xFF98FB98; } Color c = Colors.PaleGreen; //action int actual = ColorUtilities.ColorToBgra32(c.R, c.G, c.B); //assert Assert.AreEqual(expected, actual); }
public override Brush GetColorDetailsBrush(HsvColor c) { int b = c.ToRgb().B; for (int r = 0; r < ByteValues; r++) { for (int g = 0; g < ByteValues; g++) { _pixels[g * ByteValues + r] = ColorUtilities.ColorToBgra32(r, byte.MaxValue - g, b); } } _wb.WritePixels(_sourceRect, _pixels, ByteValues * 4, 0); ImageBrush br = new ImageBrush(_wb); return(br); }