Build with static rainbow

This commit is contained in:
Philipp David 2022-03-18 10:28:35 +01:00
parent 26acc836d9
commit e8373bbf65
No known key found for this signature in database
GPG Key ID: 967A5D5EB5071577
4 changed files with 11 additions and 47 deletions

View File

@ -941,8 +941,8 @@ target_link_libraries(Launcher_logic
Launcher_iconfix
QuaZip::QuaZip
hoedown
Launcher_rainbow
LocalPeer
Launcher_rainbow
)
target_link_libraries(Launcher_logic)

View File

@ -8,15 +8,7 @@ set(RAINBOW_SOURCES
src/rainbow.cpp
)
add_definitions(-DRAINBOW_LIBRARY)
add_library(Launcher_rainbow SHARED ${RAINBOW_SOURCES})
add_library(Launcher_rainbow STATIC ${RAINBOW_SOURCES})
target_include_directories(Launcher_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(Launcher_rainbow Qt5::Core Qt5::Gui)
# Install it
install(
TARGETS Launcher_rainbow
RUNTIME DESTINATION ${LIBRARY_DEST_DIR}
LIBRARY DESTINATION ${LIBRARY_DEST_DIR}
)

View File

@ -23,8 +23,6 @@
#pragma once
#include "rainbow_config.h"
#include <QPainter>
class QColor;
@ -43,13 +41,13 @@ namespace Rainbow
*
* @see http://en.wikipedia.org/wiki/Luma_(video)
*/
RAINBOW_EXPORT qreal luma(const QColor &);
qreal luma(const QColor &);
/**
* Calculate hue, chroma and luma of a color in one call.
* @since 5.0
*/
RAINBOW_EXPORT void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *luma,
void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *luma,
qreal *alpha = 0);
/**
@ -64,7 +62,7 @@ RAINBOW_EXPORT void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *lum
*
* @see Rainbow::luma
*/
RAINBOW_EXPORT qreal contrastRatio(const QColor &, const QColor &);
qreal contrastRatio(const QColor &, const QColor &);
/**
* Adjust the luma of a color by changing its distance from white.
@ -81,7 +79,7 @@ RAINBOW_EXPORT qreal contrastRatio(const QColor &, const QColor &);
* component of the color; 1.0 means no change, 0.0 maximizes chroma
* @see Rainbow::shade
*/
RAINBOW_EXPORT QColor
QColor
lighten(const QColor &, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
/**
@ -99,7 +97,7 @@ lighten(const QColor &, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
* component of the color; 1.0 means no change, 0.0 minimizes chroma
* @see Rainbow::shade
*/
RAINBOW_EXPORT QColor darken(const QColor &, qreal amount = 0.5, qreal chromaGain = 1.0);
QColor darken(const QColor &, qreal amount = 0.5, qreal chromaGain = 1.0);
/**
* Adjust the luma and chroma components of a color. The amount is added
@ -113,7 +111,7 @@ RAINBOW_EXPORT QColor darken(const QColor &, qreal amount = 0.5, qreal chromaGai
* 1.0 maximizes chroma
* @see Rainbow::luma
*/
RAINBOW_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount = 0.0);
QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount = 0.0);
/**
* Create a new color by tinting one color with another. This function is
@ -127,7 +125,7 @@ RAINBOW_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount
* @param amount how strongly to tint the base; 0.0 gives @p base,
* 1.0 gives @p color
*/
RAINBOW_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount = 0.3);
QColor tint(const QColor &base, const QColor &color, qreal amount = 0.3);
/**
* Blend two colors into a new color by linear combination.
@ -140,7 +138,7 @@ RAINBOW_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount
* @p bias >= 1 gives @p c2. @p bias == 0.5 gives a 50% blend of @p c1
* and @p c2.
*/
RAINBOW_EXPORT QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
/**
* Blend two colors into a new color by painting the second color over the
@ -154,7 +152,7 @@ RAINBOW_EXPORT QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
* @param paint the color to be overlayed onto the base color.
* @param comp the CompositionMode used to do the blending.
*/
RAINBOW_EXPORT QColor
QColor
overlayColors(const QColor &base, const QColor &paint,
QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver);
}

View File

@ -1,26 +0,0 @@
/* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <QtCore/QtGlobal>
#ifdef RAINBOW_STATIC
#define RAINBOW_EXPORT
#else
#ifdef RAINBOW_LIBRARY
#define RAINBOW_EXPORT Q_DECL_EXPORT
#else
#define RAINBOW_EXPORT Q_DECL_IMPORT
#endif
#endif