public Vector4f normalize(float length, Vector4f dest) { float invLength = 1.0f / length() * length; dest.x = x * invLength; dest.y = y * invLength; dest.z = z * invLength; dest.w = w * invLength; return dest; }
public Vector4f normalize(Vector4f dest) { float invLength = 1.0f / length(); dest.x = x * invLength; dest.y = y * invLength; dest.z = z * invLength; dest.w = w * invLength; return dest; }
public Vector4f normalize(float length, Vector4f dest) { float invLength = 1.0f / length() * length; dest.x = x * invLength; dest.y = y * invLength; dest.z = z * invLength; dest.w = w * invLength; return dest; }
public Vector4f normalize(Vector4f dest) { float invLength = 1.0f / length(); dest.x = x * invLength; dest.y = y * invLength; dest.z = z * invLength; dest.w = w * invLength; return dest; }
@Override public void apply(T component) { super.apply(component); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } component.getStyle().getBackground().setColor(ColorConstants.red()); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); component.getStyle().getBackground().setColor(settings.backgroundColor()); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); component.getStyle().getBackground().setColor(settings.denyColor()); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } component.getHoveredStyle().getBackground().setColor(settings.denyColor().mul(1.3f, 1.3f, 1.3f, 1f)); component.getPressedStyle().getBackground().setColor(settings.denyColor().mul(1.6f, 1.6f, 1.6f, 1f)); component.setToggledBackgroundColor(settings.allowColor()); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } component.getFocusedStyle().getBackground() .setColor(settings.backgroundColor().mul(3).add(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())).div(4)); component.getTextState().setTextColor(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())); component.getTextState().setHorizontalAlign(HorizontalAlign.LEFT); component.getTextState().setHighlightColor(settings.strokeColor()); component.getStyle().getBackground().setColor(settings.backgroundColor()); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } component.getFocusedStyle().getBackground() .setColor(settings.backgroundColor().mul(3).add(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())).div(4)); component.getTextState().setTextColor(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())); component.getTextState().setHorizontalAlign(HorizontalAlign.LEFT); component.getTextState().setHighlightColor(settings.strokeColor()); component.getStyle().getBackground().setColor(settings.backgroundColor()); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); component.getStyle().getBackground().setColor(settings.backgroundColor()); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } component.getHoveredStyle().getBackground() .setColor(settings.backgroundColor().mul(3).add(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())).div(4)); component.getPressedStyle().getBackground() .setColor(settings.backgroundColor().mul(2).add(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())).div(3)); component.getTextState().setTextColor(ColorUtil.oppositeBlackOrWhite(settings.backgroundColor())); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); Vector4f bgc = ColorUtil.oppositeBlackOrWhite(settings.backgroundColor().mul(3)).add(settings.backgroundColor().mul(3)).div(4); component.getStyle().getBackground().setColor(bgc); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } Component viewport = component.getViewport(); Themes.getDefaultTheme().apply(viewport); Themes.getDefaultTheme().applyAll(component.getVerticalScrollBar()); Themes.getDefaultTheme().applyAll(component.getHorizontalScrollBar()); viewport.getStyle().getBackground().setColor(ColorConstants.transparent()); component.getStyle().setBorder(new SimpleLineBorder(settings.borderColor(), 1)); component.getViewport().getStyle().setBorder(new SimpleLineBorder(settings.borderColor(), 1)); }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); Vector4f bgc = ColorUtil.oppositeBlackOrWhite(settings.backgroundColor().mul(3)).add(settings.backgroundColor().mul(3)).div(4); component.getStyle().getBackground().setColor(bgc); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } Component viewport = component.getViewport(); Themes.getDefaultTheme().apply(viewport); Themes.getDefaultTheme().applyAll(component.getVerticalScrollBar()); Themes.getDefaultTheme().applyAll(component.getHorizontalScrollBar()); viewport.getStyle().getBackground().setColor(ColorConstants.transparent()); component.getContainer().getStyle().getBackground().setColor(new Vector4f(bgc)); component.getStyle().setBorder(new SimpleLineBorder(settings.borderColor(), 1)); component.getViewport().getStyle().setBorder(new SimpleLineBorder(settings.borderColor(), 1)); }
super.apply(component); component.getStyle().getBackground().setColor(settings.backgroundColor()); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else {
component.getStyle().getBackground().setColor(settings.backgroundColor()); if (settings.shadowColor() == null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else {