Merge pull request #322 from oynqr/build/static-rainbow
Build with static rainbow
This commit is contained in:
commit
64399dd8d6
@ -941,8 +941,8 @@ target_link_libraries(Launcher_logic
|
|||||||
Launcher_iconfix
|
Launcher_iconfix
|
||||||
QuaZip::QuaZip
|
QuaZip::QuaZip
|
||||||
hoedown
|
hoedown
|
||||||
PolyMC_rainbow
|
|
||||||
LocalPeer
|
LocalPeer
|
||||||
|
Launcher_rainbow
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(Launcher_logic)
|
target_link_libraries(Launcher_logic)
|
||||||
|
@ -8,15 +8,7 @@ set(RAINBOW_SOURCES
|
|||||||
src/rainbow.cpp
|
src/rainbow.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_definitions(-DRAINBOW_LIBRARY)
|
add_library(Launcher_rainbow STATIC ${RAINBOW_SOURCES})
|
||||||
add_library(PolyMC_rainbow SHARED ${RAINBOW_SOURCES})
|
target_include_directories(Launcher_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
target_include_directories(PolyMC_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
||||||
|
|
||||||
target_link_libraries(PolyMC_rainbow Qt5::Core Qt5::Gui)
|
target_link_libraries(Launcher_rainbow Qt5::Core Qt5::Gui)
|
||||||
|
|
||||||
# Install it
|
|
||||||
install(
|
|
||||||
TARGETS PolyMC_rainbow
|
|
||||||
RUNTIME DESTINATION ${LIBRARY_DEST_DIR}
|
|
||||||
LIBRARY DESTINATION ${LIBRARY_DEST_DIR}
|
|
||||||
)
|
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "rainbow_config.h"
|
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
class QColor;
|
class QColor;
|
||||||
|
|
||||||
@ -43,13 +41,13 @@ namespace Rainbow
|
|||||||
*
|
*
|
||||||
* @see http://en.wikipedia.org/wiki/Luma_(video)
|
* @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.
|
* Calculate hue, chroma and luma of a color in one call.
|
||||||
* @since 5.0
|
* @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);
|
qreal *alpha = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,7 +62,7 @@ RAINBOW_EXPORT void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *lum
|
|||||||
*
|
*
|
||||||
* @see Rainbow::luma
|
* @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.
|
* 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
|
* component of the color; 1.0 means no change, 0.0 maximizes chroma
|
||||||
* @see Rainbow::shade
|
* @see Rainbow::shade
|
||||||
*/
|
*/
|
||||||
RAINBOW_EXPORT QColor
|
QColor
|
||||||
lighten(const QColor &, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
|
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
|
* component of the color; 1.0 means no change, 0.0 minimizes chroma
|
||||||
* @see Rainbow::shade
|
* @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
|
* 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
|
* 1.0 maximizes chroma
|
||||||
* @see Rainbow::luma
|
* @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
|
* 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,
|
* @param amount how strongly to tint the base; 0.0 gives @p base,
|
||||||
* 1.0 gives @p color
|
* 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.
|
* 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
|
* @p bias >= 1 gives @p c2. @p bias == 0.5 gives a 50% blend of @p c1
|
||||||
* and @p c2.
|
* 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
|
* 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 paint the color to be overlayed onto the base color.
|
||||||
* @param comp the CompositionMode used to do the blending.
|
* @param comp the CompositionMode used to do the blending.
|
||||||
*/
|
*/
|
||||||
RAINBOW_EXPORT QColor
|
QColor
|
||||||
overlayColors(const QColor &base, const QColor &paint,
|
overlayColors(const QColor &base, const QColor &paint,
|
||||||
QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver);
|
QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver);
|
||||||
}
|
}
|
||||||
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user