blob: a11853303aeb09128c60f26dd18d657a553d4c5c [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2009, 2018 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.rj.graphic.core;
/**
* Configures paint color.
*/
public class RColorSetting extends RPaintSetting {
public final int color;
/**
* Creates a new color setting.
*
* @param color color
*/
public RColorSetting(final int color) {
this.color= color;
}
@Override
public final byte getInstructionType() {
return SET_COLOR;
}
public final int getAlpha() {
return ((this.color >> 24) & 255);
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
final StringBuilder sb= new StringBuilder();
sb.append("RPaintColor[(");
sb.append(this.color & 255);
sb.append(", ");
sb.append((this.color >> 8) & 255);
sb.append(", ");
sb.append((this.color >> 16) & 255);
sb.append("), ");
sb.append((this.color >> 24) & 255);
sb.append("]");
return sb.toString();
}
}