Here you can find the source of RGBtoBGR(String color)
Parameter | Description |
---|---|
color | RGB/ARGB color string |
public static String RGBtoBGR(String color)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w. ja va 2 s .com*/ * Converts RGB (ARBG) color to BGR (ABGR). * If color is without alpha - makes alpha "FF". * * @param color RGB/ARGB color string * @return Converted color */ public static String RGBtoBGR(String color) { if (color.length() == 6) { color = "FF" + color; } if (color.length() == 8) { return color.substring(0, 2) + color.substring(6, 8) + color.substring(4, 6) + color.substring(2, 4); } return color; } }