import { Color } from '@mapgis/webclient-common'

class CesiumPluginUtil {
  /**
   * @description 颜色转换
   * @private
   * @param {Color|String} color
   * @return {Cesium.Color}
   */
  static convertColorToRgb(color) {
    if (color instanceof Color) {
      return Cesium.Color.fromCssColorString(color.toCssRGBAString())
    } else if (typeof color === 'string') {
      return Cesium.Color.fromCssColorString(color)
    } else {
      color = new Color()
      return Cesium.Color.fromCssColorString(color.toCssRGBAString())
    }
  }
}

export default CesiumPluginUtil
